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); }
public void IsTrue_Pass() { MockAssertResultHandler mockAssert = new MockAssertResultHandler(); ServiceLocator.AssertResultHandler = mockAssert; MWTAssert.IsTrue(true, "Error Message"); UnitTestAssert.AreEqual("Assert.IsTrue", mockAssert.LastMessage); }
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); }