public void Init() { XmlElementPath path = new XmlElementPath(); path.AddElement(new QualifiedName("a", "a-namespace")); paths = new XmlElementPathsByNamespace(path); }
public void Init() { XmlElementPath path = new XmlElementPath(); path.AddElement(new QualifiedName("a", "a-namespace")); path.AddElement(new QualifiedName("b", "b-namespace")); paths = new XmlElementPathsByNamespace(path); }
public void ElementPathsByNamespaceFoo() { XmlElementPathsByNamespace paths = new XmlElementPathsByNamespace(path); XmlElementPath fooPath = paths[0]; XmlElementPath expectedPath = new XmlElementPath(); expectedPath.AddElement(new QualifiedName("foo", "http://foo", "f")); Assert.IsTrue(expectedPath.Equals(fooPath)); }
public void ElementPathsByNamespaceBar() { XmlElementPathsByNamespace paths = new XmlElementPathsByNamespace(path); XmlElementPath barPath = paths[1]; XmlElementPath expectedPath = new XmlElementPath(); expectedPath.AddElement(new QualifiedName("bar", "http://bar", "b")); Assert.IsTrue(expectedPath.Equals(barPath)); }
public void TwoNamespacesInScopeAndOneNamespaceUsedInPathNamespacesWithoutPathsReturnsUnusedNamespace() { path.AddElement(new QualifiedName("foo-root", "http://foo")); path.NamespacesInScope.Add(fooNamespace); path.NamespacesInScope.Add(barNamespace); XmlElementPathsByNamespace pathsByNamespaces = new XmlElementPathsByNamespace(path); XmlNamespace[] expectedNamespaces = new XmlNamespace[] {barNamespace}; Assert.AreEqual(expectedNamespaces, pathsByNamespaces.NamespacesWithoutPaths.ToArray()); }
public void TwoNamespacesInScopeAndOneNamespaceUsedInPathNamespacesWithoutPathsReturnsUnusedNamespace() { path.AddElement(new QualifiedName("foo-root", "http://foo")); path.NamespacesInScope.Add(fooNamespace); path.NamespacesInScope.Add(barNamespace); XmlElementPathsByNamespace pathsByNamespaces = new XmlElementPathsByNamespace(path); XmlNamespace[] expectedNamespaces = new XmlNamespace[] { barNamespace }; Assert.AreEqual(expectedNamespaces, pathsByNamespaces.NamespacesWithoutPaths.ToArray()); }
public void TwoElementPathsByNamespace() { XmlElementPathsByNamespace paths = new XmlElementPathsByNamespace(path); Assert.AreEqual(2, paths.Count); }
public void Init() { XmlElementPath path = new XmlElementPath(); paths = new XmlElementPathsByNamespace(path); }