void funcThrows(string msg) { throw new Exception(msg); } funcThrows("foo bar").shouldThrowWithMessage!Exception("foo bar"); funcThrows("foo bar").shouldThrowWithMessage("foo bar"); assertFail(funcThrows("boo boo").shouldThrowWithMessage("foo bar"));
Verify that an exception is thrown with the right message