dunit.assertion

Members

Classes

AssertAllException
class AssertAllException

Thrown on an assertion failure.

AssertException
class AssertException

Thrown on an assertion failure.

Functions

assertAll
void assertAll(void delegate() @safe[] assertions...)

Asserts that all assertions pass.

assertArrayEquals
void assertArrayEquals(in T[] expected, in U[] actual, lazy string msg = null, string file = __FILE__, size_t line = __LINE__)

Asserts that the arrays are equal.

assertArrayEquals
void assertArrayEquals(in T[V] expected, in U[V] actual, lazy string msg = null, string file = __FILE__, size_t line = __LINE__)

Asserts that the associative arrays are equal.

assertEmpty
void assertEmpty(T actual, lazy string msg = null, string file = __FILE__, size_t line = __LINE__)

Asserts that the value is empty.

assertEquals
void assertEquals(T expected, U actual, lazy string msg = null, string file = __FILE__, size_t line = __LINE__)

Asserts that the string values are equal.

assertEquals
void assertEquals(T expected, U actual, lazy string msg = null, string file = __FILE__, size_t line = __LINE__)

Asserts that the floating-point values are approximately equal.

assertEquals
void assertEquals(T expected, U actual, lazy string msg = null, string file = __FILE__, size_t line = __LINE__)

Asserts that the values are equal.

assertFalse
void assertFalse(T condition, lazy string msg = null, string file = __FILE__, size_t line = __LINE__)

Asserts that a condition is false.

assertNotEmpty
void assertNotEmpty(T actual, lazy string msg = null, string file = __FILE__, size_t line = __LINE__)

Asserts that the value is not empty.

assertNotNull
void assertNotNull(T actual, lazy string msg = null, string file = __FILE__, size_t line = __LINE__)

Asserts that the value is not null.

assertNotSame
void assertNotSame(T expected, U actual, lazy string msg = null, string file = __FILE__, size_t line = __LINE__)

Asserts that the values are not the same.

assertNull
void assertNull(T actual, lazy string msg = null, string file = __FILE__, size_t line = __LINE__)

Asserts that the value is null.

assertRangeEquals
void assertRangeEquals(R1 expected, R2 actual, lazy string msg = null, string file = __FILE__, size_t line = __LINE__)

Asserts that the ranges are equal.

assertSame
void assertSame(T expected, U actual, lazy string msg = null, string file = __FILE__, size_t line = __LINE__)

Asserts that the values are the same.

assertTrue
void assertTrue(T condition, lazy string msg = null, string file = __FILE__, size_t line = __LINE__)

Asserts that a condition is true.

description
string description(Throwable throwable)

Returns a description of the throwable.

expectThrows
T expectThrows(lazy E expression, lazy string msg = null, string file = __FILE__, size_t line = __LINE__)

Asserts that the expression throws the specified throwable.

fail
void fail(string msg = null, string file = __FILE__, size_t line = __LINE__)

Fails a test.

Static functions

assertEventually
void assertEventually(bool delegate() probe, Duration timeout = 500.msecs, Duration delay = 10.msecs, lazy string msg = null, string file = __FILE__, size_t line = __LINE__)

Checks a probe until the timeout expires. The assert error is produced if the probe fails to return 'true' before the timeout.

Templates

assertOp
template assertOp(string op)

Asserts that the condition (lhs op rhs) is satisfied.

Meta