本文整理汇总了C#中ICSharpCode.XmlEditor.XmlElementPath.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# XmlElementPath.Equals方法的具体用法?C# XmlElementPath.Equals怎么用?C# XmlElementPath.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICSharpCode.XmlEditor.XmlElementPath
的用法示例。
在下文中一共展示了XmlElementPath.Equals方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Equality
public void Equality()
{
XmlElementPath newPath = new XmlElementPath();
newPath.Elements.Add(new QualifiedName("foo", "http://foo"));
Assert.IsTrue(newPath.Equals(path), "Should be equal.");
}
示例2: NotEqual
public void NotEqual()
{
XmlElementPath newPath = new XmlElementPath();
newPath.Elements.Add(new QualifiedName("Foo", "bar"));
Assert.IsFalse(newPath.Equals(path), "Should not be equal.");
}
示例3: EmptyDocumentTest
public void EmptyDocumentTest()
{
elementPath = XmlParser.GetActiveElementStartPathAtIndex("", 0);
expectedElementPath = new XmlElementPath();
Assert.IsTrue(elementPath.Equals(expectedElementPath),
"Incorrect active element path.");
}
示例4: CompactPathItem
public void CompactPathItem()
{
XmlElementPath newPath = new XmlElementPath();
newPath.AddElement(new QualifiedName("bar", "http://bar", "b"));
path.Compact();
Assert.IsTrue(newPath.Equals(path), "Should be equal.");
}
示例5: NotEqual
public void NotEqual()
{
XmlElementPath newPath = new XmlElementPath();
newPath.AddElement(new QualifiedName("aaa", "a", "a"));
newPath.AddElement(new QualifiedName("bbb", "b", "b"));
Assert.IsFalse(newPath.Equals(path), "Should not be equal.");
}
示例6: ElementPathsByNamespaceFoo
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));
}
示例7: PathTest1
public void PathTest1()
{
string text = "<foo xmlns='" + namespaceURI + "' ";
elementPath = XmlParser.GetActiveElementStartPath(text, text.Length);
expectedElementPath = new XmlElementPath();
expectedElementPath.Elements.Add(new QualifiedName("foo", namespaceURI));
Assert.IsTrue(elementPath.Equals(expectedElementPath),
"Incorrect active element path.");
}
示例8: GetActiveElementStartPathForRootElementWithNamespacePrefix
public void GetActiveElementStartPathForRootElementWithNamespacePrefix()
{
string text = "<x:foo xmlns:x='" + namespaceURI + "' ";
elementPath = XmlParser.GetActiveElementStartPath(text, text.Length);
expectedElementPath = new XmlElementPath();
expectedElementPath.AddElement(new QualifiedName("foo", namespaceURI, "x"));
Assert.IsTrue(expectedElementPath.Equals(elementPath),
"Incorrect active element path.");
}
示例9: SuccessTest4
public void SuccessTest4()
{
string text = "<bar xmlns='http://test.com'><foo xmlns='" + namespaceURI + "' ><";
elementPath = XmlParser.GetParentElementPath(text);
expectedElementPath = new XmlElementPath();
expectedElementPath.Elements.Add(new QualifiedName("foo", namespaceURI));
Assert.IsTrue(elementPath.Equals(expectedElementPath),
"Incorrect active element path.");
}
示例10: GetParentElementPathForRootElementAfterEmptyChildElementEnd
public void GetParentElementPathForRootElementAfterEmptyChildElementEnd()
{
string text = "<foo xmlns='" + namespaceURI + "' ><bar/><";
elementPath = XmlParser.GetParentElementPath(text);
expectedElementPath = new XmlElementPath();
expectedElementPath.AddElement(new QualifiedName("foo", namespaceURI));
Assert.IsTrue(elementPath.Equals(expectedElementPath),
"Incorrect active element path.");
}
示例11: ElementPathsByNamespaceBar
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));
}
示例12: GetParentElementPathForTwoElementsInDifferentNamespaces
public void GetParentElementPathForTwoElementsInDifferentNamespaces()
{
string text = "<bar xmlns='http://test.com'><foo xmlns='" + namespaceURI + "' ><";
elementPath = XmlParser.GetParentElementPath(text);
expectedElementPath = new XmlElementPath();
expectedElementPath.AddElement(new QualifiedName("bar", "http://test.com"));
expectedElementPath.AddElement(new QualifiedName("foo", namespaceURI));
Assert.IsTrue(elementPath.Equals(expectedElementPath),
"Incorrect active element path.");
}
示例13: PathTest3
public void PathTest3()
{
string text = "<foo xmlns='" + namespaceURI + "'><bar>";
elementPath = XmlParser.GetActiveElementStartPathAtIndex(text, text.IndexOf("ar>"));
expectedElementPath = new XmlElementPath();
expectedElementPath.AddElement(new QualifiedName("foo", namespaceURI));
expectedElementPath.AddElement(new QualifiedName("bar", namespaceURI));
Assert.IsTrue(elementPath.Equals(expectedElementPath),
"Incorrect active element path.");
}
示例14: ComplexPathTabTest
public void ComplexPathTabTest()
{
string text = "<foo xmlns='" + namespaceURI + "'><bar";
string text2 = "\t</foo>";
elementPath = XmlParser.GetActiveElementStartPathAtIndex(text + text2, text.Length);
expectedElementPath = new XmlElementPath();
expectedElementPath.Elements.Add(new QualifiedName("foo", namespaceURI));
expectedElementPath.Elements.Add(new QualifiedName("bar", namespaceURI));
Assert.IsTrue(elementPath.Equals(expectedElementPath),
"Incorrect active element path.");
}
示例15: ChangeNamespaceForTwoElementsWithoutNamespaceModifiesAllItems
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));
}