The value used during the assertion.
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 interface A {} 2 class B : A {} 3 class C : B {} 4 5 auto b = new B(); 6 auto c = new C(); 7 8 b.assertInstanceOf!(Object)(); 9 b.assertInstanceOf!(A)(); 10 b.assertInstanceOf!(B)(); 11 12 c.assertInstanceOf!(Object)(); 13 c.assertInstanceOf!(A)(); 14 c.assertInstanceOf!(B)(); 15 c.assertInstanceOf!(C)(); 16 17 // Assert a DUnitAssertError is thrown if assertInstanceOf fails. 18 b.assertInstanceOf!(C)().assertThrow!(DUnitAssertError)("Failed asserting instance of");
Assert that a value is an instance of a type.