AssertException otherwise
1 assertEquals(42, 42); 2 3 auto exception = expectThrows!AssertException(assertEquals(42, 24)); 4 5 assertEquals("expected: <42> but was: <24>", exception.msg);
1 Object foo = new Object(); 2 Object bar = null; 3 4 assertEquals(foo, foo); 5 assertEquals(bar, bar); 6 7 auto exception = expectThrows!AssertException(assertEquals(foo, bar)); 8 9 assertEquals("expected: <object.Object> but was: <null>", exception.msg);
Asserts that the values are equal.