Interface ITestKitAssertions
This interface defines several common assert patterns used in the various testkits.
public interface ITestKitAssertions
Methods
AssertEqual<T>(T, T, Func<T, T, bool>, string, params object[])
Verifies that the two specified values (expected
and actual
are equal using a specified comparison function comparer
.
void AssertEqual<T>(T expected, T actual, Func<T, T, bool> comparer, string format = "", params object[] args)
Parameters
expected
TThe expected value of the object
actual
TThe actual value of the object
comparer
Func<T, T, bool>The function used to compare the two specified values.
format
stringA template string to display if the assertion fails.
args
object[]An optional object array that contains zero or more objects to format.
Type Parameters
T
The type that is being compared.
AssertEqual<T>(T, T, string, params object[])
Verifies that the two specified values (expected
and actual
are equal.
void AssertEqual<T>(T expected, T actual, string format = "", params object[] args)
Parameters
expected
TThe expected value of the object
actual
TThe actual value of the object
format
stringA template string to display if the assertion fails.
args
object[]An optional object array that contains zero or more objects to format.
Type Parameters
T
The type that is being compared.
AssertFalse(bool, string, params object[])
Verifies that a specified condition
is false.
void AssertFalse(bool condition, string format = "", params object[] args)
Parameters
condition
boolThe condition that is being verified.
format
stringA template string to display if the assertion fails.
args
object[]An optional object array that contains zero or more objects to format.
AssertTrue(bool, string, params object[])
Verifies that a specified condition
is true.
void AssertTrue(bool condition, string format = "", params object[] args)
Parameters
condition
boolThe condition that is being verified
format
stringA template string to display if the assertion fails
args
object[]An optional object array that contains zero or more objects to format.
Fail(string, params object[])
Fails an assertion without checking any conditions.
void Fail(string format = "", params object[] args)