shouldBeNotEmpty

Used to assert that Range is not empty.

  1. void shouldBeNotEmpty(in auto ref R rng, in string message = null, in string file = __FILE__, in size_t line = __LINE__)
    void
    shouldBeNotEmpty
    (
    R
    )
    (
    in auto ref R rng
    ,
    in string message = null
    ,
    in string file = __FILE__
    ,
    in size_t line = __LINE__
    )
    if (
    isInputRange!R
    )
  2. void shouldBeNotEmpty(auto ref T aa, in string message = null, in string file = __FILE__, in size_t line = __LINE__)

Parameters

rng
Type: R

The expected 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 Range is empty, will throw an UnitTestException with expected and actual values.

Examples

// Will throw an exception like "UnitTestException@example.d(6): Expected is not empty Range"
[1].shouldBeEmpty();

Meta