dunit.error

Module to handle exceptions.

License

MIT. See LICENSE for full details.

class DUnitAssertError: core.exception.AssertError;

An exception thrown when a unit test fails.

This exception derives from AssertError to make it possible for these errors to be thrown from nothrow methods.

pure nothrow @safe this(string message, string file, size_t line);

Constructor.

Parameters

string message The error message.
string file The file where the error occurred.
size_t line The line where the error occurred.

@property string[] log();

Return the exception log.

Return Value

The error's logged info, expectations and error messages.

void addInfo(T)(string caption, T value, string icon = "\xe2\x84\xb9");

Add a line of info to the exception log.

Parameters

string caption The caption.
T value The value.
string icon The icon before the caption.

void addTypedInfo(T)(string caption, T value, string icon = "\xe2\x84\xb9");

Add a line of typed info to the exception log.

Parameters

string caption The caption.
T value The value.
string icon The icon before the caption.

void addExpectation(T)(string caption, T value, string icon = "\xe2\x9c\x93");

Add a line of expected info to the exception log.

Parameters

string caption The caption.
T value The value.
string icon The icon before the caption.

void addTypedExpectation(T)(string caption, T value, string icon = "\xe2\x9c\x93");

Add a line of typed expected info to the exception log.

Parameters

string caption The caption.
T value The value.
string icon The icon before the caption.

void addError(T)(string caption, T value, string icon = "\xe2\x9c\x97");

Add a line of error info to the exception log.

Parameters

string caption The caption.
T value The value.
string icon The icon before the caption.

void addTypedError(T)(string caption, T value, string icon = "\xe2\x9c\x97");

Add a line of typed error info to the exception log.

Parameters

string caption The caption.
T value The value.
string icon The icon before the caption.