shouldNotBeNull

Verify that the value is not null.

void
shouldNotBeNull
(
T
)
(
const scope auto ref T value
,
string file = __FILE__
,
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