You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
93 lines
1.7 KiB
93 lines
1.7 KiB
// <file> |
|
// <copyright see="prj:///doc/copyright.txt"/> |
|
// <license see="prj:///doc/license.txt"/> |
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/> |
|
// <version>$Revision$</version> |
|
// </file> |
|
|
|
using ICSharpCode.XmlEditor; |
|
using NUnit.Framework; |
|
using System; |
|
|
|
namespace XmlEditor.Tests.Paths |
|
{ |
|
[TestFixture] |
|
public class NoElementPathTestFixture |
|
{ |
|
XmlElementPath path; |
|
|
|
[TestFixtureSetUp] |
|
public void FixtureSetUp() |
|
{ |
|
path = new XmlElementPath(); |
|
} |
|
|
|
[Test] |
|
public void HasNoItems() |
|
{ |
|
Assert.AreEqual(0, path.Elements.Count); |
|
} |
|
|
|
[Test] |
|
public void PathIsEmpty() |
|
{ |
|
Assert.IsTrue(path.IsEmpty); |
|
} |
|
|
|
[Test] |
|
public void Equality() |
|
{ |
|
XmlElementPath newPath = new XmlElementPath(); |
|
|
|
Assert.IsTrue(newPath.Equals(path), "Should be equal."); |
|
} |
|
|
|
[Test] |
|
public void EqualsItself() |
|
{ |
|
Assert.IsTrue(path.Equals(path), "Should be equal."); |
|
} |
|
|
|
[Test] |
|
public void NotEqual() |
|
{ |
|
XmlElementPath newPath = new XmlElementPath(); |
|
newPath.AddElement(new QualifiedName("Foo", "bar")); |
|
|
|
Assert.IsFalse(newPath.Equals(path), "Should not be equal."); |
|
} |
|
|
|
[Test] |
|
public void NotEqualToADifferentType() |
|
{ |
|
Object o = new Object(); |
|
Assert.IsFalse(path.Equals(o), "Should not be equal."); |
|
} |
|
|
|
[Test] |
|
public void Compact() |
|
{ |
|
path.Compact(); |
|
Equality(); |
|
} |
|
|
|
[Test] |
|
public void HashCode() |
|
{ |
|
Assert.AreEqual(path.Elements.GetHashCode(), path.GetHashCode()); |
|
} |
|
|
|
[Test] |
|
public void PathToStringIsEmpty() |
|
{ |
|
string expectedToString = String.Empty; |
|
Assert.AreEqual(expectedToString, path.ToString()); |
|
} |
|
|
|
[Test] |
|
public void RootNamespaceIsEmptyString() |
|
{ |
|
Assert.AreEqual(String.Empty, path.GetRootNamespace()); |
|
} |
|
} |
|
}
|
|
|