public void ThrowAssertInconclusiveExceptionWhenInconclusive() { AssertAll.IsFalse(false); AssertAll.AreEqual(1, 1); AssertAll.Inconclusive(); Assert.ThrowsException <AssertAllInconclusiveException>(() => AssertAll.Execute()); }
public void PassWhenThereAreNoExceptionsOrInconclusives() { AssertAll.IsFalse(false); AssertAll.AreEqual(1, 1); AssertAll.IsInstanceOfType(1, typeof(int)); AssertAll.Execute(); }
public void FailWhenLogicallyEqualButDifferentTypes() { int expected = 1; long actual = 1; AssertAll.AreEqual(expected, actual, "the types are different"); Assert.ThrowsException <AssertAllFailedException>(() => AssertAll.Execute()); }
public void ModifyStackTraceOfException() { AssertAll.AreEqual(1, 2); AssertAll.IsFalse(true); AssertAll.IsNull(1); var thrownException = Assert.ThrowsException <AssertAllFailedException>(() => AssertAll.Execute()); Assert.IsTrue(thrownException.StackTrace.ToLower().Contains("line 66"), thrownException.StackTrace); Assert.IsTrue(thrownException.StackTrace.ToLower().Contains("line 67")); Assert.IsTrue(thrownException.StackTrace.ToLower().Contains("line 68")); }
public void ShowAllTheAssertExceptions() { AssertAll.Fail("we'll see the rest in the test results"); AssertAll.IsTrue(false); AssertAll.AreEqual(1, 2); }
public void PassWhenEqual() { AssertAll.AreEqual(1, 1, "your logic is bad and you should feel bad"); AssertAll.Execute(); }
public void FailWhenNotEqual() { AssertAll.AreEqual(1, 2, "1 and 2 are not equal, ya dummy"); Assert.ThrowsException <AssertAllFailedException>(() => AssertAll.Execute()); }