xUnit.net assertions verify the behavior of methods under tests. An assertion validates the condition that is expected to be true for the results being expected. When an assertion fails, the current execution of the test is terminated and an exception is thrown. The following table explains the assertions available in xUnit.net:
Assertion |
Description |
Equal |
Validates that an object equals another object |
NotEqual |
Validates that an object does not equal another object |
Same |
Verifies that two objects are of the same type |
NotSame |
Verifies that two objects are not of the same type |
Contains |
Is an overloaded assertion/method and verifies that a string contains a given substring or a collection contains an object |
DoesNotContain |
Is an overloaded assertion/method and verifies that a string does... |