Example #1
0
        public void StringMatches_Fail()
        {
            MockAssertResultHandler mockAssert = new MockAssertResultHandler();

            ServiceLocator.AssertResultHandler = mockAssert;
            MWTAssert.StringMatches("foobar", new Regex("baz"), "This is a message '{0}'.", "foo");
            UnitTestAssert.AreEqual("This is a message 'foo'.", mockAssert.LastMessage);
        }
Example #2
0
        public void StringMatches_Pass()
        {
            MockAssertResultHandler mockAssert = new MockAssertResultHandler();

            ServiceLocator.AssertResultHandler = mockAssert;
            MWTAssert.StringMatches("foobar", new Regex("bar"), "Error Message");
            UnitTestAssert.AreEqual("Assert.StringMatches: Value <foobar>, Expression Matched <bar>!", mockAssert.LastMessage);
        }