1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
4
using ICSharpCode.XmlEditor;
9
namespace XmlEditor.Tests.Parser
12
/// Tests the comparison of <see cref="QualifiedName"/> items.
15
public class QualifiedNameTestFixture
18
public void EqualsTest1()
20
QualifiedName name1 = new QualifiedName("foo", "http://foo.com");
21
QualifiedName name2 = new QualifiedName("foo", "http://foo.com");
23
Assert.AreEqual(name1, name2, "Should be the same.");
27
public void EqualsTest2()
29
QualifiedName name1 = new QualifiedName("foo", "http://foo.com", "f");
30
QualifiedName name2 = new QualifiedName("foo", "http://foo.com", "f");
32
Assert.AreEqual(name1, name2, "Should be the same.");
36
public void EqualsTest3()
38
QualifiedName name1 = new QualifiedName("foo", "http://foo.com", "f");
39
QualifiedName name2 = new QualifiedName("foo", "http://foo.com", "ggg");
41
Assert.IsTrue(name1 == name2, "Should be the same.");
45
public void NotEqualsTest1()
47
QualifiedName name1 = new QualifiedName("foo", "http://foo.com", "f");
48
QualifiedName name2 = new QualifiedName("foo", "http://bar.com", "f");
50
Assert.IsFalse(name1 == name2, "Should not be the same.");
54
public void NotEqualsTest2()
56
QualifiedName name1 = new QualifiedName("foo", "http://foo.com", "f");
57
QualifiedName name2 = null;
59
Assert.IsFalse(name1 == name2, "Should not be the same.");
63
public void HashCodeTest()
65
QualifiedName name1 = new QualifiedName("foo", "http://foo.com", "f");
66
XmlQualifiedName xmlQualifiedName = new XmlQualifiedName("foo", "http://foo.com");
68
Assert.AreEqual(name1.GetHashCode(), xmlQualifiedName.GetHashCode());