shouldNotBeNull

Verify that the value is not null.

void
shouldNotBeNull
(
T
)
(
in 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)) ;
shouldEqual(new Foo(5), new Foo(5));
assertFail(shouldEqual(new Foo(5), new Foo(4)));
shouldNotEqual(new Foo(5), new Foo(4)) ;
assertFail(shouldNotEqual(new Foo(5), new Foo(5)));

Meta