Expect

Wrapper whose methods are expectations.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

not
ExpectNot!TReceived not()

Negates the expectation. Returns an ExpectNot.

toApproximatelyEqual
void toApproximatelyEqual(TExpected expected, F maxRelDiff, F maxAbsDiff)

Checks that received.isClose(expected, maxRelDiff, maxAbsDiff) and throws a FailingExpectationException otherwise.

toBe
void toBe(TExpected expected)

Checks that received is expected and throws a FailingExpectationException otherwise.

toBeOfType
void toBeOfType()

Checks that received is a TExpected or a sub-type of it. Throws a FailingExpectationException if received cannot be cast to TExpected or if received is null.

toEqual
void toEqual(TExpected expected)

Checks that received == expected and throws FailingExpectationException otherwise.

toSatisfy
void toSatisfy(bool delegate(const(TReceived)) predicate)

Checks that predicate(received) returns true and throws a FailingExpectationException otherwise.

toSatisfyAll
void toSatisfyAll(bool delegate(const(TReceived))[] predicates)

Checks that predicate(received) returns true for all predicates and throws a FailingExpectationException otherwise.

toSatisfyAny
void toSatisfyAny(bool delegate(const(TReceived))[] predicates)

Checks that predicate(received) returns true for at least one of the given predicates and throws a FailingExpectationException otherwise.

toThrow
void toThrow()

Calls received and catches any exceptions thrown by it. There are three possible outcomes:

Meta