Beispiel #1
0
 public void ThrowAssertInconclusiveExceptionWhenInconclusive()
 {
     AssertAll.IsFalse(false);
     AssertAll.AreEqual(1, 1);
     AssertAll.Inconclusive();
     Assert.ThrowsException <AssertAllInconclusiveException>(() => AssertAll.Execute());
 }
Beispiel #2
0
 public void PassWhenThereAreNoExceptionsOrInconclusives()
 {
     AssertAll.IsFalse(false);
     AssertAll.AreEqual(1, 1);
     AssertAll.IsInstanceOfType(1, typeof(int));
     AssertAll.Execute();
 }
Beispiel #3
0
        public void FailWhenLogicallyEqualButDifferentTypes()
        {
            int  expected = 1;
            long actual   = 1;

            AssertAll.AreEqual(expected, actual, "the types are different");

            Assert.ThrowsException <AssertAllFailedException>(() => AssertAll.Execute());
        }
Beispiel #4
0
        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"));
        }
Beispiel #5
0
 public void ShowAllTheAssertExceptions()
 {
     AssertAll.Fail("we'll see the rest in the test results");
     AssertAll.IsTrue(false);
     AssertAll.AreEqual(1, 2);
 }
Beispiel #6
0
        public void PassWhenEqual()
        {
            AssertAll.AreEqual(1, 1, "your logic is bad and you should feel bad");

            AssertAll.Execute();
        }
Beispiel #7
0
        public void FailWhenNotEqual()
        {
            AssertAll.AreEqual(1, 2, "1 and 2 are not equal, ya dummy");

            Assert.ThrowsException <AssertAllFailedException>(() => AssertAll.Execute());
        }