Exemplo n.º 1
0
 public void IfAllAssertsPassNoExceptionIsThrown()
 {
     using (var asserts = new AssertsAggregator("dummy"))
     {
         asserts.AreEqual(3, () => 3, "3 always equal 3");
         asserts.AreEqual(4, () => 4, "4 always equal 4");
         asserts.IsTrue(() => true, "true is always true...");
     }
 }
        public void AssertAggregatorCanHaveBooleanAsserts()
        {
            using (var asserts = new AssertsAggregator("dummy"))
            {
                asserts.IsTrue(() => true, "true is always true...");
            }

            Action negativeTest = () =>
            {
                using (var asserts = new AssertsAggregator("dummy"))
                {
                    asserts.IsTrue(() => false, "false is never true...");
                }
            };

            TestUtils.ExpectException<AssertFailedException>(negativeTest);
        }
Exemplo n.º 3
0
        public void AssertAggregatorCanHaveBooleanAsserts()
        {
            using (var asserts = new AssertsAggregator("dummy"))
            {
                asserts.IsTrue(() => true, "true is always true...");
            }

            Action negativeTest = () =>
            {
                using (var asserts = new AssertsAggregator("dummy"))
                {
                    asserts.IsTrue(() => false, "false is never true...");
                }
            };

            TestUtils.ExpectException <AssertFailedException>(negativeTest);
        }
 public void IfAllAssertsPassNoExceptionIsThrown()
 {
     using (var asserts = new AssertsAggregator("dummy"))
     {
         asserts.AreEqual(3, () => 3, "3 always equal 3");
         asserts.AreEqual(4, () => 4, "4 always equal 4");
         asserts.IsTrue(() => true, "true is always true...");
     }
 }