shouldBeIn

* Verify that the value is in the container. * Throws: UnitTestException on failure

  1. void shouldBeIn(T value, U container, string file, size_t line)
    void
    shouldBeIn
    (
    T
    U
    )
    (
    in T value
    ,,
    in string file = __FILE__
    ,
    in size_t line = __LINE__
    )
  2. void shouldBeIn(T value, U container, string file, size_t line)

Examples

5.shouldBeIn([5: "foo"]);

struct AA {
    int onlyKey;
    bool opBinaryRight(string op)(in int key) const {
        return key == onlyKey;
    }
}

5.shouldBeIn(AA(5));
assertFail(5.shouldBeIn(AA(4)));

Meta