Ejemplo n.º 1
0
        public void StringIsNotNullOrEmpty_Pass()
        {
            MockAssertResultHandler mockAssert = new MockAssertResultHandler();

            ServiceLocator.AssertResultHandler = mockAssert;
            MWTAssert.StringIsNotNullOrEmpty("foobar", "Error Message");
            UnitTestAssert.AreEqual("Assert.StringIsNotNullOrEmpty: Expected: <non-null and not String.Empty>, Actual Value <String.Empty>!", mockAssert.LastMessage);
        }
Ejemplo n.º 2
0
        public void StringIsNotNullOrEmpty_Fail()
        {
            MockAssertResultHandler mockAssert = new MockAssertResultHandler();

            ServiceLocator.AssertResultHandler = mockAssert;
            string s = null;

            MWTAssert.StringIsNotNullOrEmpty(s, "This is a message '{0}'.", "foo");
            UnitTestAssert.AreEqual("This is a message 'foo'.", mockAssert.LastMessage);
        }