The array to interogate.
The value the array should contain.
The error message to display.
The file name where the error occurred. The value is added automatically at the call site.
The line where the error occurred. The value is added automatically at the call site.
DUnitAssertError if the assertation fails.
1 "Hello".assertHasValue("H"); 2 [1, 2, 3, 4].assertHasValue(2); 3 ["foo", "bar", "baz", "qux"].assertHasValue("foo"); 4 [["foo", "bar"], ["baz", "qux"]].assertHasValue(["foo", "bar"]); 5 ["foo":1, "bar":2, "baz":3, "qux":4].assertHasValue(4); 6 7 // Assert a DUnitAssertError is thrown if assertHasValue fails. 8 ["foo":"bar"].assertHasValue("baz").assertThrow!(DUnitAssertError)("Failed asserting array has value");
Assert that an array contains a particular value.