Ejemplo n.º 1
0
        [Test] public void AssertStringEqualAndIdenticalToSelf()
        {
            string control = "<assert>true</assert>";
            string test    = "<assert>true</assert>";

            XmlAssertion.AssertXmlIdentical(control, test);
            XmlAssertion.AssertXmlEquals(control, test);
        }
Ejemplo n.º 2
0
        [Test] public void AssertXmlIdenticalUsesOptionalDescription()
        {
            string description = "An Optional Description";

            try {
                XmlDiff diff = new XmlDiff(new XmlInput("<a/>"), new XmlInput("<b/>"),
                                           new DiffConfiguration(description));
                XmlAssertion.AssertXmlIdentical(diff);
            } catch (NUnit.Framework.AssertionException e) {
                Assertion.AssertEquals(true, e.Message.StartsWith(description));
            }
        }
Ejemplo n.º 3
0
        [Test] public void AssertXmlIdenticalUsesOptionalDescription()
        {
            string description     = "An Optional Description";
            bool   caughtException = true;

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