Пример #1
0
        [Test] public void AssertStringEqualAndIdenticalToSelf()
        {
            string control = "<assert>true</assert>";
            string test    = "<assert>true</assert>";

            XmlAssertion.AssertXmlIdentical(control, test);
            XmlAssertion.AssertXmlEquals(control, test);
        }
Пример #2
0
        [Test] public void AssertXmlEqualsUsesOptionalDescription()
        {
            string description = "Another Optional Description";

            try {
                XmlDiff diff = new XmlDiff(new XmlInput("<a/>"), new XmlInput("<b/>"),
                                           new DiffConfiguration(description));
                XmlAssertion.AssertXmlEquals(diff);
            } catch (NUnit.Framework.AssertionException e) {
                Assertion.AssertEquals(true, e.Message.StartsWith(description));
            }
        }
Пример #3
0
        [Test] public void AssertXmlEqualsUsesOptionalDescription()
        {
            string description     = "Another Optional Description";
            bool   caughtException = true;

            try {
                XmlDiff diff = new XmlDiff(new XmlInput("<a/>"), new XmlInput("<b/>"),
                                           new DiffConfiguration(description));
                XmlAssertion.AssertXmlEquals(diff);
                caughtException = false;
            } catch (NUnit.Framework.AssertionException e) {
                Assert.IsTrue(e.Message.IndexOf(description) > -1);
            }
            Assert.IsTrue(caughtException);
        }