shouldNotEqual

Used to assert that one value is not equal to another value.

void
shouldNotEqual
(
T
U
)
(
,,
in string message = null
,
in string file = __FILE__
,
in size_t line = __LINE__
)

Parameters

value
Type: T

The value to test.

expected
Type: U

The value it should not be equal to.

message
Type: string

The exception message.

file
Type: string

The file name that the assert failed in. Should be left as default.

line
Type: size_t

The file line that the assert failed in. Should be left as default.

Throws

If values are equal, will throw an UnitTestException with expected and actual values.

Examples

// Will throw an exception like "checkit.exception.UnitTestException@example.d(6): Expected not <abc>, got <abc>"
"abc".shouldNotEqual("abc");

Meta