Class
Assert

A set of assertion methods useful for writing tests.

Definition

Namespace:ArtOfTest.Common.UnitTesting

Assembly:ArtOfTest.WebAii.dll

Syntax:

cs-api-definition
public static class Assert

Inheritance: objectAssert

Methods

AreEqual<T>(T, T)

Asserts that two objects are equal.

Declaration

cs-api-definition
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

cs-api-definition
public static void AreEqual<T>(T expected, T actual, string message)

Parameters

expected

T

The expected object.

actual

T

The actual object.

message

string

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

cs-api-definition
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

cs-api-definition
public static void AreNotEqual<T>(T expected, T actual, string message)

Parameters

expected

T

The expected object.

actual

T

The actual object.

message

string

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.

Declaration

cs-api-definition
public static void AreSame(object expected, object actual)

Parameters

expected

object

The expected object.

actual

object

The actual object.

Exceptions

The exception thrown if the assertion fails.

AreSame(object, object, string)

Asserts that two object are the same instance.

Declaration

cs-api-definition
public static void AreSame(object expected, object actual, string message)

Parameters

expected

object

The expected object.

actual

object

The actual object.

message

string

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

cs-api-definition
public static void IsFalse(bool condition)

Parameters

condition

bool

The condition to check.

IsFalse(bool, string)

Asserts that a condition is false.

Declaration

cs-api-definition
public static void IsFalse(bool condition, string message)

Parameters

condition

bool

The condition to check against.

message

string

The message of the AssertException that is thrown if the assertion fails.

Exceptions

The exception thrown if the assertion fails.

IsNotNull(object)

Asserts that an object is not null.

Declaration

cs-api-definition
public static void IsNotNull(object value)

Parameters

value

object

The object to check against.

IsNotNull(object, string)

Asserts that an object is not null.

Declaration

cs-api-definition
public static void IsNotNull(object value, string message)

Parameters

value

object

The object to check against.

message

string

The message of the AssertException that is thrown if the assertion fails.

Exceptions

The exception thrown if the assertion fails.

IsNull(object)

Asserts that an object is null.

Declaration

cs-api-definition
public static void IsNull(object value)

Parameters

value

object

The object to check against.

IsNull(object, string)

Asserts that an object is null.

Declaration

cs-api-definition
public static void IsNull(object value, string message)

Parameters

value

object

The object to check against.

message

string

The message of the AssertException that is thrown if the assertion fails.

Exceptions

The exception thrown if the assertion fails.

IsTrue(bool)

Asserts that a condition is true.

Declaration

cs-api-definition
public static void IsTrue(bool condition)

Parameters

condition

bool

The condition to check against.

IsTrue(bool, string)

Asserts that a condition is true.

Declaration

cs-api-definition
public static void IsTrue(bool condition, string message)

Parameters

condition

bool

The condition to check against.

message

string

The message of the AssertException that is thrown if the assertion fails.

Exceptions

The exception thrown if the assertion fails.