ConditionConstraints test a specific condition and are named for the condition they test. They verify that the actual value satisfies the condition. The following condition helpers are provided.
Tests that a value is Null.
NullConstraint()
Is.Null
Assert.That( anObject, Is.Null ); Assert.That( anObject, Is.Not.Null );
Tests that a value is true.
TrueConstraint()
Is.True
Assert.That( condition, Is.True );
Tests that a value is false.
FalseConstraint()
Is.False
Assert.That( condition, Is.False );
Tests that a value is floating-point NaN.
NaNConstraint()
Is.NaN
Assert.That( aDouble, Is.NaN ); Assert.That( aDouble, Is.Not.NaN );
Tests that an object is an empty string or collection.
EmptyConstraint()
Is.Empty
Assert.That( aString, Is.Empty ); Assert.That( collection, Is.Empty );
Tests that an array, collection or other IEnumerable is composed of unique items with no duplicates.
UniqueItemsConstraint()
Is.Unique
Assert.That( collection, Is.Unique );