Ejemplo n.º 1
0
        public void ElementSameIgnoringChildren_MissingChildren_ShouldFail()
        {
            XElement root1 = XElement.Parse(@"<xmlns:Root a='1' b='2' xmlns='http://www.northwind.com' />");
            XElement root2 = XElement.Parse(@"<xmlns:Root b='2' a='1' xmlns='http://www.northwind.com'><xmlns:Child>1</xmlns:Child></xmlns:Root>");

            Assert.IsFalse(XmlCompare.ElementSameIgnoringChildren(root1, root2).AreSame);
        }
Ejemplo n.º 2
0
        public void ElementSameIgnoringChildren_ValuesMatch_ShouldSucceed()
        {
            XElement root1 = XElement.Parse(@"<Root a='1' b='2' xmlns='http://www.northwind.com'>2</Root>");
            XElement root2 = XElement.Parse(@"<n:Root b='2' a='1' xmlns:n='http://www.northwind.com'>2</n:Root>");

            Assert.IsTrue(XmlCompare.ElementSameIgnoringChildren(root1, root2).AreSame);
        }