ClassAssert
A set of assertion methods useful for writing tests.
Definition
Namespace:ArtOfTest.Common.UnitTesting
Assembly:ArtOfTest.WebAii.dll
Syntax:
public static class Assert
Inheritance: objectAssert
Methods
AreEqual<T>(T, T)
Asserts that two objects are equal.
Declaration
public static void AreEqual<T>(T expected, T actual)
Parameters
expected
T
The expected object.
actual
T
The actual object.
AreEqual<T>(T, T, string)
Asserts that two objects are equal.
Declaration
public static void AreEqual<T>(T expected, T actual, string message)
Parameters
expected
T
The expected object.
actual
T
The actual object.
message
The message of the AssertException that is thrown if the assertion fails.
Exceptions
The exception thrown if the assertion fails.
AreNotEqual<T>(T, T)
Asserts that two objects are not equal.
Declaration
public static void AreNotEqual<T>(T expected, T actual)
Parameters
expected
T
The expected object.
actual
T
The actual object.
AreNotEqual<T>(T, T, string)
Asserts that two objects are not equal.
Declaration
public static void AreNotEqual<T>(T expected, T actual, string message)
Parameters
expected
T
The expected object.
actual
T
The actual object.
message
The message of the AssertException that is thrown if the assertion fails.
Exceptions
The exception thrown if the assertion fails.
AreSame(object, object)
Asserts that two object are the same instance.
AreSame(object, object, string)
Asserts that two object are the same instance.
Declaration
public static void AreSame(object expected, object actual, string message)
Parameters
expected
The expected object.
actual
The actual object.
message
The message of the AssertException that is thrown if the assertion fails.
Exceptions
The exception thrown if the assertion fails.
IsFalse(bool)
Asserts that a condition is false.
Declaration
public static void IsFalse(bool condition)
Parameters
condition
The condition to check.
IsFalse(bool, string)
Asserts that a condition is false.
IsNotNull(object)
Asserts that an object is not null.
Declaration
public static void IsNotNull(object value)
Parameters
value
The object to check against.
IsNotNull(object, string)
Asserts that an object is not null.
IsNull(object)
Asserts that an object is null.
Declaration
public static void IsNull(object value)
Parameters
value
The object to check against.
IsNull(object, string)
Asserts that an object is null.
IsTrue(bool)
Asserts that a condition is true.
Declaration
public static void IsTrue(bool condition)
Parameters
condition
The condition to check against.
IsTrue(bool, string)
Asserts that a condition is true.