The associative array to interogate.
The key 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 ["foo":1, "bar":2, "baz":3, "qux":4].assertHasKey("foo"); 2 [1:"foo", 2:"bar", 3:"baz", 4:"qux"].assertHasKey(1); 3 4 // Assert a DUnitAssertError is thrown if assertHasKey fails. 5 ["foo":"bar"].assertHasKey("baz").assertThrow!(DUnitAssertError)("Failed asserting array has key");
Assert that an associative array contains a particular key.