Ejemplo n.º 1
0
        public void ChangeNamespaceForTwoElementsWhereChildElementHasOwnNamespaceOnlyAffectsRootElement()
        {
            XmlElementPath path = new XmlElementPath();

            path.AddElement(new QualifiedName("root", String.Empty));
            path.AddElement(new QualifiedName("child", "has-namespace-already"));
            path.SetNamespaceForUnqualifiedNames("http://test");

            XmlElementPath expectedPath = new XmlElementPath();

            expectedPath.AddElement(new QualifiedName("root", "http://test"));
            expectedPath.AddElement(new QualifiedName("child", "has-namespace-already"));

            Assert.IsTrue(expectedPath.Equals(path));
        }
Ejemplo n.º 2
0
        public void ChangeNamespaceForTwoElementsWithoutNamespaceModifiesAllItems()
        {
            XmlElementPath path = new XmlElementPath();

            path.AddElement(new QualifiedName("root", String.Empty));
            path.AddElement(new QualifiedName("child", String.Empty));
            path.SetNamespaceForUnqualifiedNames("http://test");

            XmlElementPath expectedPath = new XmlElementPath();

            expectedPath.AddElement(new QualifiedName("root", "http://test"));
            expectedPath.AddElement(new QualifiedName("child", "http://test"));

            Assert.IsTrue(expectedPath.Equals(path));
        }