public void StringDoesNotMatch_Fail() { MockAssertResultHandler mockAssert = new MockAssertResultHandler(); ServiceLocator.AssertResultHandler = mockAssert; MWTAssert.StringDoesNotMatch("foobar", new Regex("foo"), "This is a message '{0}'.", "foo"); UnitTestAssert.AreEqual("This is a message 'foo'.", mockAssert.LastMessage); }
public void StringDoesNotMatch_Pass() { MockAssertResultHandler mockAssert = new MockAssertResultHandler(); ServiceLocator.AssertResultHandler = mockAssert; MWTAssert.StringDoesNotMatch("foobar", new Regex("baz"), "Error Message"); UnitTestAssert.AreEqual("Assert.StringDoesNotMatch: Value <foobar>, Expression That Does Not Match <baz>!", mockAssert.LastMessage); }