assertTrue

Assert that a boolean value is true.

void
assertTrue
(
T
)
(
,
string message = "Failed asserting true"
,
string file = __FILE__
,
size_t line = __LINE__
)

Parameters

value
Type: T

The value used during the assertion.

message
Type: string

The error message to display.

file
Type: string

The file name where the error occurred. The value is added automatically at the call site.

line
Type: size_t

The line where the error occurred. The value is added automatically at the call site.

Throws

DUnitAssertError if the assertation fails.

Examples

true.assertTrue();

// Assert a DUnitAssertError is thrown if assertTrue fails.
false.assertTrue().assertThrow!(DUnitAssertError)("Failed asserting true");

Meta