Пример #1
0
        public void IsTrue_Fail()
        {
            MockAssertResultHandler mockAssert = new MockAssertResultHandler();

            ServiceLocator.AssertResultHandler = mockAssert;
            MWTAssert.IsTrue(false, "This is a message '{0}'.", "foo");
            UnitTestAssert.AreEqual("This is a message 'foo'.", mockAssert.LastMessage);
        }
Пример #2
0
        public void IsTrue_Pass()
        {
            MockAssertResultHandler mockAssert = new MockAssertResultHandler();

            ServiceLocator.AssertResultHandler = mockAssert;
            MWTAssert.IsTrue(true, "Error Message");
            UnitTestAssert.AreEqual("Assert.IsTrue", mockAssert.LastMessage);
        }
Пример #3
0
        public void IsTrue_Nullable_Pass()
        {
            MockAssertResultHandler mockAssert = new MockAssertResultHandler();

            ServiceLocator.AssertResultHandler = mockAssert;
            bool?condition = true;

            MWTAssert.IsTrue(condition, "Error Message");
            UnitTestAssert.AreEqual("Assert.IsTrue", mockAssert.LastMessage);
        }