ClassicAssert
The Assert class contains a collection of static methods that
implement the most common assertions used in NUnit.
protected ClassicAssert()
public static void AreEqual(double expected, double actual, double delta, string message, object[] args)
Verifies that two doubles are equal considering a delta. If the expected value is infinity then the delta
value is ignored. Returns without throwing an exception when inside a multiple assert block.
Verifies that two doubles are equal considering a delta. If the expected value is infinity then the delta
value is ignored. Returns without throwing an exception when inside a multiple assert block.
Verifies that two objects are equal. Two objects are considered equal if both are null, or if both have the
same value. NUnit has special semantics for some object types. Returns without throwing an exception when
inside a multiple assert block.
Verifies that two objects are equal. Two objects are considered equal if both are null, or if both have the
same value. NUnit has special semantics for some object types. Returns without throwing an exception when
inside a multiple assert block.
Verifies that two objects are not equal. Two objects are considered equal if both are null, or if both have
the same value. NUnit has special semantics for some object types. Returns without throwing an exception
when inside a multiple assert block.
Verifies that two objects are not equal. Two objects are considered equal if both are null, or if both have
the same value. NUnit has special semantics for some object types. Returns without throwing an exception
when inside a multiple assert block.
Asserts that two objects do not refer to the same object. Returns without throwing an exception when inside
a multiple assert block.
Asserts that two objects do not refer to the same object. Returns without throwing an exception when inside
a multiple assert block.
Asserts that two objects refer to the same object. Returns without throwing an exception when inside a
multiple assert block.
Asserts that two objects refer to the same object. Returns without throwing an exception when inside a
multiple assert block.
protected static void AssertDoublesAreEqual(double expected, double actual, double delta, string message, object[] args)
Helper for Assert.AreEqual(double expected, double actual, ...)
allowing code generation to work consistently.
Asserts that an object is contained in a collection. Returns without throwing an exception when inside a
multiple assert block.
Asserts that an object is contained in a collection. Returns without throwing an exception when inside a
multiple assert block.
DO NOT USE! Use Assert.AreEqual(...) instead.
The Equals method throws an InvalidOperationException. This is done
to make sure there is no mistake by calling this function.
Asserts that a condition is false. Returns without throwing an exception when inside a multiple assert
block.
Asserts that a condition is false. Returns without throwing an exception when inside a multiple assert
block.
Asserts that a condition is false. Returns without throwing an exception when inside a multiple assert block.
Asserts that a condition is false. Returns without throwing an exception when inside a multiple assert
block.
Verifies that the first int is greater than the second
int. If it is not, then an
AssertionException is thrown.
Verifies that the first int is greater than the second
int. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than or equal to the second
value. If it is not, then an
AssertionException is thrown.
public static void GreaterOrEqual(IComparable arg1, IComparable arg2, string message, object[] args)
Verifies that the first value is greater than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is greater than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Asserts that an object may be assigned a value of a given Type. Returns without throwing an exception when
inside a multiple assert block.
Asserts that an object may be assigned a value of a given Type. Returns without throwing an exception when
inside a multiple assert block.
Asserts that an object may be assigned a value of a given Type. Returns without throwing an exception when
inside a multiple assert block.
Asserts that an object may be assigned a value of a given Type. Returns without throwing an exception when
inside a multiple assert block.
Assert that a string is empty. Returns without throwing an exception when inside a multiple assert block.
Assert that a string is empty. Returns without throwing an exception when inside a multiple assert block.
Assert that an array, list or other collection is empty. Returns without throwing an exception when inside a
multiple assert block.
Assert that an array, list or other collection is empty. Returns without throwing an exception when inside a
multiple assert block.
Asserts that a condition is false. Returns without throwing an exception when inside a multiple assert
block.
Asserts that a condition is false. Returns without throwing an exception when inside a multiple assert
block.
Asserts that a condition is false. Returns without throwing an exception when inside a multiple assert
block.
Asserts that a condition is false. Returns without throwing an exception when inside a multiple assert
block.
Asserts that an object is an instance of a given type. Returns without throwing an exception when inside a
multiple assert block.
Asserts that an object is an instance of a given type. Returns without throwing an exception when inside a
multiple assert block.
Asserts that an object is an instance of a given type. Returns without throwing an exception when inside a
multiple assert block.
Asserts that an object is an instance of a given type. Returns without throwing an exception when inside a
multiple assert block.
Verifies that the double that is passed in is an NaN. Returns without throwing an
exception when inside a multiple assert block.
Verifies that the double that is passed in is an NaN value. Returns without throwing an
exception when inside a multiple assert block.
Verifies that the double that is passed in is an NaN value. Returns without throwing an
exception when inside a multiple assert block.
Verifies that the double that is passed in is an NaN value. Returns without throwing an
exception when inside a multiple assert block.
Asserts that an object may not be assigned a value of a given Type. Returns without throwing an exception
when inside a multiple assert block.
Asserts that an object may not be assigned a value of a given Type. Returns without throwing an exception
when inside a multiple assert block.
Asserts that an object may not be assigned a value of a given Type. Returns without throwing an exception
when inside a multiple assert block.
Asserts that an object may not be assigned a value of a given Type. Returns without throwing an exception
when inside a multiple assert block.
Assert that a string is not empty. Returns without throwing an exception when inside a multiple assert
block.
Assert that a string is not empty. Returns without throwing an exception when inside a multiple assert
block.
Assert that an array, list or other collection is not empty. Returns without throwing an exception when
inside a multiple assert block.
Assert that an array, list or other collection is not empty. Returns without throwing an exception when
inside a multiple assert block.
Asserts that an object is not an instance of a given type. Returns without throwing an exception when inside
a multiple assert block.
Asserts that an object is not an instance of a given type. Returns without throwing an exception when inside
a multiple assert block.
Asserts that an object is not an instance of a given type. Returns without throwing an exception when inside
a multiple assert block.
Asserts that an object is not an instance of a given type. Returns without throwing an exception when inside
a multiple assert block.
Verifies that the object that is passed in is not equal to null. Returns without throwing an
exception when inside a multiple assert block.
Verifies that the object that is passed in is not equal to null. Returns without throwing an
exception when inside a multiple assert block.
Verifies that the object that is passed in is equal to null. Returns without throwing an
exception when inside a multiple assert block.
Verifies that the object that is passed in is equal to null. Returns without throwing an
exception when inside a multiple assert block.
Asserts that a condition is true. Returns without throwing an exception when inside a multiple assert block.
Asserts that a condition is true. Returns without throwing an exception when inside a multiple assert block.
Asserts that a condition is true. Returns without throwing an exception when inside a multiple assert block.
Asserts that a condition is true. Returns without throwing an exception when inside a multiple assert block.
Verifies that the first value is less than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Verifies that the first value is less than or equal to the second
value. If it is not, then an
AssertionException is thrown.
Asserts that an int is negative. Returns without throwing an exception when inside a multiple assert block.
Asserts that an int is negative. Returns without throwing an exception when inside a multiple assert block.
Asserts that an unsigned int is negative. Returns without throwing an exception when inside a multiple
assert block.
Asserts that an unsigned int is negative. Returns without throwing an exception when inside a multiple
assert block.
Asserts that a Long is negative. Returns without throwing an exception when inside a multiple assert block.
Asserts that a Long is negative. Returns without throwing an exception when inside a multiple assert block.
Asserts that an unsigned Long is negative. Returns without throwing an exception when inside a multiple
assert block.
Asserts that an unsigned Long is negative. Returns without throwing an exception when inside a multiple
assert block.
Asserts that a decimal is negative. Returns without throwing an exception when inside a multiple assert
block.
Asserts that a decimal is negative. Returns without throwing an exception when inside a multiple assert
block.
Asserts that a double is negative. Returns without throwing an exception when inside a multiple assert
block.
Asserts that a double is negative. Returns without throwing an exception when inside a multiple assert
block.
Asserts that a float is negative. Returns without throwing an exception when inside a multiple assert block.
Asserts that a float is negative. Returns without throwing an exception when inside a multiple assert block.
Verifies that the object that is passed in is not equal to null. Returns without throwing an
exception when inside a multiple assert block.
Verifies that the object that is passed in is not equal to null. Returns without throwing an
exception when inside a multiple assert block.
Asserts that an int is not zero. Returns without throwing an exception when inside a multiple assert block.
Asserts that an int is not zero. Returns without throwing an exception when inside a multiple assert block.
Asserts that an unsigned int is not zero. Returns without throwing an exception when inside a multiple
assert block.
Asserts that an unsigned int is not zero. Returns without throwing an exception when inside a multiple
assert block.
Asserts that a Long is not zero. Returns without throwing an exception when inside a multiple assert block.
Asserts that a Long is not zero. Returns without throwing an exception when inside a multiple assert block.
Asserts that an unsigned Long is not zero. Returns without throwing an exception when inside a multiple
assert block.
Asserts that an unsigned Long is not zero. Returns without throwing an exception when inside a multiple
assert block.
Asserts that a decimal is zero. Returns without throwing an exception when inside a multiple assert block.
Asserts that a decimal is zero. Returns without throwing an exception when inside a multiple assert block.
Asserts that a double is zero. Returns without throwing an exception when inside a multiple assert block.
Asserts that a double is zero. Returns without throwing an exception when inside a multiple assert block.
Asserts that a float is zero. Returns without throwing an exception when inside a multiple assert block.
Asserts that a float is zero. Returns without throwing an exception when inside a multiple assert block.
Verifies that the object that is passed in is equal to null. Returns without throwing an
exception when inside a multiple assert block.
Verifies that the object that is passed in is equal to null. Returns without throwing an
exception when inside a multiple assert block.
Asserts that an int is positive. Returns without throwing an exception when inside a multiple assert block.
Asserts that an int is positive. Returns without throwing an exception when inside a multiple assert block.
Asserts that an unsigned int is positive. Returns without throwing an exception when inside a multiple
assert block.
Asserts that an unsigned int is positive. Returns without throwing an exception when inside a multiple
assert block.
Asserts that a Long is positive. Returns without throwing an exception when inside a multiple assert block.
Asserts that a Long is positive. Returns without throwing an exception when inside a multiple assert block.
Asserts that an unsigned Long is positive. Returns without throwing an exception when inside a multiple
assert block.
Asserts that an unsigned Long is positive. Returns without throwing an exception when inside a multiple
assert block.
Asserts that a decimal is positive. Returns without throwing an exception when inside a multiple assert
block.
Asserts that a decimal is positive. Returns without throwing an exception when inside a multiple assert
block.
Asserts that a double is positive. Returns without throwing an exception when inside a multiple assert
block.
Asserts that a double is positive. Returns without throwing an exception when inside a multiple assert block.
Asserts that a float is positive. Returns without throwing an exception when inside a multiple assert block.
Asserts that a float is positive. Returns without throwing an exception when inside a multiple assert block.
DO NOT USE!
The ReferenceEquals method throws an InvalidOperationException. This is done
to make sure there is no mistake by calling this function.
Asserts that a condition is true. Returns without throwing an exception when inside a multiple assert block.
Asserts that a condition is true. Returns without throwing an exception when inside a multiple assert block.
Asserts that a condition is true. Returns without throwing an exception when inside a multiple assert block.
Asserts that a condition is true. Returns without throwing an exception when inside a multiple assert block.
Asserts that an int is zero. Returns without throwing an exception when inside a multiple assert block.
Asserts that an int is zero. Returns without throwing an exception when inside a multiple assert block.
Asserts that an unsigned int is zero. Returns without throwing an exception when inside a multiple assert
block.
Asserts that an unsigned int is zero. Returns without throwing an exception when inside a multiple assert
block.
Asserts that a Long is zero. Returns without throwing an exception when inside a multiple assert block.
Asserts that a Long is zero. Returns without throwing an exception when inside a multiple assert block.
Asserts that an unsigned Long is zero. Returns without throwing an exception when inside a multiple assert
block.
Asserts that an unsigned Long is zero. Returns without throwing an exception when inside a multiple assert
block.
Asserts that a decimal is zero. Returns without throwing an exception when inside a multiple assert block.
Asserts that a decimal is zero. Returns without throwing an exception when inside a multiple assert block.
Asserts that a double is zero. Returns without throwing an exception when inside a multiple assert block.
Asserts that a double is zero. Returns without throwing an exception when inside a multiple assert block.
Asserts that a float is zero. Returns without throwing an exception when inside a multiple assert block.
Asserts that a float is zero. Returns without throwing an exception when inside a multiple assert block.