shouldBeIn

Verify that the value is in the container.

  1. void shouldBeIn(in auto ref T value, in auto ref U container, in string file = __FILE__, in size_t line = __LINE__)
  2. void shouldBeIn(in auto ref T value, U container, in string file = __FILE__, in size_t line = __LINE__)
    void
    shouldBeIn
    (
    T
    U
    )
    (
    in auto ref T value
    ,,
    in string file = __FILE__
    ,
    in size_t line = __LINE__
    )
    if (
    !isLikeAssociativeArray!(U, T) &&
    isInputRange!U
    )

Throws

UnitTestException on failure

Examples

shouldBeIn(4, [1, 2, 4]);
shouldBeIn("foo", ["foo" : 1]);
assertFail("foo".shouldBeIn(["bar"]));

Meta