shouldBeNotEmpty

Used to assert that Associative array is not empty.

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

Parameters

aa
Type: T

The expected associative array.

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 Associative array 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 Associative Array"
["test":12].shouldBeEmpty();

Meta