Search⌘ K
AI Features

Assert Value Categories

Explore NUnit assertions for testing different C# value categories such as Null, NotNull, Zero, NotZero, IsNaN, IsEmpty, and IsNotEmpty. Understand how to apply these assertions to verify edge cases in your unit tests, including practical examples with quadratic equations to detect roots and value conditions.

Introduction

C# types store values which are categorized into the following groups:

  • Null
  • NotNull
  • Zero
  • NotZero
  • IsNaN
  • IsEmpty
  • IsNotEmpty

NUnit provides facilities to assert against these value categories.

Conceptually

...