assertLessThanOrEqual

Assert that a value is less than or equal to a threshold value.

void
assertLessThanOrEqual
(
A
B
)
(,,
string message = "Failed asserting less than or equal"
,
string file = __FILE__
,
size_t line = __LINE__
)

Parameters

value A

The value used during the assertion.

threshold B

The threshold value.

message string

The error message to display.

file string

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

line size_t

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

Throws

DUnitAssertError if the assertation fails.

Examples

10.assertLessThanOrEqual(10);
9.assertLessThanOrEqual(10);

// Assert a DUnitAssertError is thrown if assertLessThanOrEqual fails.
9.assertLessThanOrEqual(8).assertThrow!(DUnitAssertError)("Failed asserting less than or equal");

Meta