shouldNotBeNull

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

void
shouldNotBeNull
(
T
)
(
in auto ref T value
,
in string message = null
,
in string file = __FILE__
,
in size_t line = __LINE__
)

Parameters

value
Type: T

The value that should not equal null.

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 value is null, will throw an UnitTestException.

Examples

// Will throw an exception like "checkit.exception.UnitTestException@example.d(6): Expected not <null>, got <null>"
string test = null;
test.shouldNotBeNull();

Meta