示例#1
0
 public void FailWhenThereAreFailures()
 {
     AssertAll.IsFalse(false);
     AssertAll.Inconclusive();
     AssertAll.Fail();
     Assert.ThrowsException <AssertAllFailedException>(() => AssertAll.Execute());
 }
示例#2
0
 public void ThrowAssertInconclusiveExceptionWhenInconclusive()
 {
     AssertAll.IsFalse(false);
     AssertAll.AreEqual(1, 1);
     AssertAll.Inconclusive();
     Assert.ThrowsException <AssertAllInconclusiveException>(() => AssertAll.Execute());
 }
示例#3
0
 public void PassWhenThereAreNoExceptionsOrInconclusives()
 {
     AssertAll.IsFalse(false);
     AssertAll.AreEqual(1, 1);
     AssertAll.IsInstanceOfType(1, typeof(int));
     AssertAll.Execute();
 }
示例#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"));
        }
示例#5
0
        public void FailWhenTrue()
        {
            AssertAll.IsFalse(true, "1 and 2 are the same");

            Assert.ThrowsException <AssertAllFailedException>(() => AssertAll.Execute());
        }
示例#6
0
        public void PassWhenFalse()
        {
            AssertAll.IsFalse(1 == 2, "1 and 2 are not the same");

            AssertAll.Execute();
        }