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
Type: A

The value used during the assertion.

threshold
Type: B

The threshold value.

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

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

Meta