예제 #1
0
 public void FailWhenThereAreFailures()
 {
     AssertAll.IsFalse(false);
     AssertAll.Inconclusive();
     AssertAll.Fail();
     Assert.ThrowsException <AssertAllFailedException>(() => AssertAll.Execute());
 }
예제 #2
0
 internal static void TestMethod(this AssertAll source, bool passes)
 {
     if (passes == false)
     {
         AssertAll.Fail();
     }
 }
예제 #3
0
        public void AllFailureAndInconclusiveMessagesAreIncluded()
        {
            var message1 = RandomValue.String();
            var message2 = RandomValue.String();
            var message3 = RandomValue.String();

            AssertAll.IsTrue(true, message1);
            AssertAll.Fail(message2);
            AssertAll.Inconclusive(message3);

            try
            {
                AssertAll.Execute();
            }
            catch (Exception e)
            {
                var message = e.Message;
                Assert.IsFalse(message.Contains(message1));
                Assert.IsTrue(message.Contains(message2));
                Assert.IsTrue(message.Contains(message3));
            }
        }
예제 #4
0
        public void Fail()
        {
            AssertAll.Fail();

            Assert.ThrowsException <AssertAllFailedException>(() => AssertAll.Execute());
        }
예제 #5
0
 public void ShowAllTheAssertExceptions()
 {
     AssertAll.Fail("we'll see the rest in the test results");
     AssertAll.IsTrue(false);
     AssertAll.AreEqual(1, 2);
 }