shouldNotBeNull

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

void
shouldNotBeNull
(
T
)
(
T a
,
string message = null
,
string file = __FILE__
,
size_t line = __LINE__
)

Parameters

a
Type: T

The value that should NOT equal null.

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 AssertError.

Examples

// Will throw an exception like "AssertError@example.d(6): expected to NOT be <null>."
string z = null;
z.shouldNotBeNull();

Meta