shouldNotBeNull

Verify that the value is not null.

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

Throws

UnitTestException on failure

Examples

class Foo
{
    this(int i) { this.i = i; }
    override string toString() const
    {
        import std.conv: to;
        return i.to!string;
    }
    int i;
}

shouldNotBeNull(new Foo(4));

Meta