public void OddNumberFails() { try { MyAssert.IsOdd(28); Assert.Fail("An AssertionException was expected but not thrown"); } catch (AssertionException ae) { Assert.AreEqual(ae.Message, "\texpected: odd number" + System.Environment.NewLine + "\tactual: <28>", "AssertionException thrown with incorrect message"); } catch (Exception ex) { Assert.Fail("Expected AssertionException but caught: " + ex.ToString()); } }
public void OddNumber() { MyAssert.IsOdd(27); }