ExpectNot

Provides negated versions of the usual expectations in Expect.

Constructors

this
this(const(TReceived) received, string filePath, size_t line)
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

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

Succeeds if `received.isClose(expected, maxRelDiff, maxAbsDiff)` is false. Throws a FailingExpectationError otherwise.

toBe
void toBe(TExpected expected)

Succeeds if received !is expected. Throws a FailingExpectationError otherwise.

toBeOfType
void toBeOfType()

Succeeds if received is neither TExpected nor a sub-type of it. Throws a FailingExpectationError if received can be cast to TExpected.

toContain
void toContain(bool delegate(const(ElementType!TReceived)) predicate)

Succeeds if received doesn't contain the fobidden element or sub-range, or if it doesn't contain any elements satisfying the given predicate.

toContain
void toContain(TExpected forbidden)

Succeeds if received doesn't contain the fobidden element or sub-range, or if it doesn't contain any elements satisfying the given predicate.

toContainOnly
void toContainOnly(TExpected expected)
void toContainOnly(bool delegate(const(ElementType!TReceived)) predicate)

Succeeds if there is at least one elemt in received not equal to expected, or if at least one element in received doesn't satisfy predicate.

toEqual
void toEqual(TExpected expected)

Succeeds if received != expected. Throws a FailingExpectationError otherwise.

toMatch
void toMatch(TExpected pattern, string flags)

Succeeds if received does not match the regular expression pattern. Throws a FailingExpectationError otherwise.

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

Succeeds if predicate(received) returns false. Throws a FailingExpectationError otherwise.

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

Succeeds if predicate(received) returns false for at least one of the given predicates. Throws a FailingExpectationError otherwise.

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

Succeeds if predicate(received) returns false for all predicates. Throws a FailingExpectationError otherwise.

toThrow
void toThrow()

Calls received and catches any exceptions thrown by it. Succeeds if it doesn't catch TExpected or a sub-type. Throws a FailingExpectationError otherwise.

Meta