shouldBeBetweenOrEqual

Used to assert that value is between or equal two values.

void
shouldBeBetweenOrEqual
(
T
U
C
)
(
,,,
string message = null
,
string file = __FILE__
,
size_t line = __LINE__
)

Parameters

value
Type: T

The expected value

left
Type: U

The expected left value of range.

right
Type: C

The expected right value of range.

message
Type: string

Exception message.

file
Type: string

The file name that the assert failed in. Should be left as default.

line
Type: size_t

The file line that the assert failed in. Should be left as default.

Throws

If the value is not between or equal, will throw an UnitTestException with expected and actual values.

Examples

// Will throw an exception like "UnitTestException@example.d(6): <5> expected to be between <15> and <20>."
10.shouldBeBetweenOrEqual(15, 20);

Meta