The methods of the Assert class are listed below. For a complete list of Assert class members, see the Assert Members topic.
Public Static Methods
AssertEquals Obsolete. Obsolete! Don't use! Assert.Equals(Object expected, Object actual) instead.
AssertFalse Obsolete. Obsolete! Don't use! Use Assert.False(bool Expression) instead.
AssertNotEquals Obsolete. Obsolete! Don't use! Use Assert.NotEquals(Object obj1, Object obj2) instead.
AssertTrue Obsolete. Obsolete! Don't use! Use Assert.True(bool expression) instead.
Contains Overloaded. Assert that a string is member of a string array. The search is case sensitive.
DoesNotContain Overloaded. Assert, that a string is not contained in a search string. The search is case sensitive.
Equals Overloaded. Assert two objects are equal.
EqualsRegex Overloaded. Compares the given string (actual) against the regular expression. If the expression does not match on the string, then an assertion is raised.
Fail Overloaded. Call this method immediately after the line, that should have thrown an exception. To be used for checked exceptions.
False Overloaded. Verify whether expression is 'false'.
Greater Overloaded. Asserts that an object is greater than a different object. Both objects must be of the same type, and that type must implement the System.IComparable interface.
Less Overloaded. Asserts that an object is less than a different object. Both objects must be of the same type, and that type must implement the System.IComparable interface.
NotEquals Overloaded. Assert two objects are NOT equal.
NotEqualsRegex Overloaded. Compares the given string (actual) against the regular expression. If the expression does match on the string, then an assertion is raised.
NotNull Overloaded. Assert object is not null.
Null Overloaded. Assert a reference is 'null'.
ReferenceEquals Overloaded. Assert that object reference refer to the same object.
StartsWith Overloaded. Assert that a string starts with a particular substring. The check is case sensitive.
True Overloaded. Verify whether expression is 'true'.
Public Instance Methods
Equals (inherited from Object )Overloaded.
Determines whether the specified Object is equal to the current Object .
GetHashCode (inherited from Object )
Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object )
Gets the Type of the current instance.
ToString (inherited from Object )
Returns a String that represents the current Object .
Protected Instance Methods
Finalize (inherited from Object )
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object )
Creates a shallow copy of the current Object .
See Also
Assert Class | csUnit Namespace