Update of /cvsroot/mvp-xml/Common/v2/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22746/v2/test
Modified Files:
CommonTest.csproj
Added Files:
EmptyXPathNodeIteratorTests.cs
SingletonXPathNodeIteratorTests.cs
Log Message:
--- NEW FILE: EmptyXPathNodeIteratorTests.cs ---
using System;
using System.Xml.XPath;
using Mvp.Xml.Common.XPath;
using NUnit.Framework;
namespace Mvp.Xml.Tests
{
[TestFixture]
public class EmptyXPathNodeIteratorTests
{
[Test]
public void Test1()
{
EmptyXPathNodeIterator ni = EmptyXPathNodeIterator.Instance;
while (ni.MoveNext())
{
Assert.Fail("EmptyXPathNodeIterator must be empty");
}
}
[Test]
public void Test2()
{
EmptyXPathNodeIterator ni = EmptyXPathNodeIterator.Instance;
Assert.IsTrue(ni.MoveNext() == false);
Assert.IsTrue(ni.Count == 0);
Assert.IsTrue(ni.Current == null);
Assert.IsTrue(ni.CurrentPosition == 0);
}
}
}
--- NEW FILE: SingletonXPathNodeIteratorTests.cs ---
using System;
using System.IO;
using System.Xml.XPath;
using Mvp.Xml.Common.XPath;
using NUnit.Framework;
namespace Mvp.Xml.Tests
{
[TestFixture]
public class SingletonXPathNodeIteratorTests
{
[Test]
public void Test1()
{
XPathDocument doc = new XPathDocument(new StringReader("<foo/>"));
XPathNavigator node = doc.CreateNavigator().SelectSingleNode("/*");
SingletonXPathNodeIterator ni = new SingletonXPathNodeIterator(node);
Assert.IsTrue(ni.MoveNext());
Assert.IsTrue(ni.Current == node);
Assert.IsFalse(ni.MoveNext());
}
}
}
Index: CommonTest.csproj
===================================================================
RCS file: /cvsroot/mvp-xml/Common/v2/test/CommonTest.csproj,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- CommonTest.csproj 28 Oct 2005 20:01:48 -0000 1.3
+++ CommonTest.csproj 29 Oct 2005 21:13:11 -0000 1.4
@@ -110,6 +110,7 @@
<Compile Include="DebugUtils.cs">
<SubType>Code</SubType>
</Compile>
+ <Compile Include="EmptyXPathNodeIteratorTests.cs" />
<Compile Include="Globals.cs">
<SubType>Code</SubType>
</Compile>
@@ -122,6 +123,7 @@
<Compile Include="pubsNs.cs">
<SubType>Code</SubType>
</Compile>
+ <Compile Include="SingletonXPathNodeIteratorTests.cs" />
<Compile Include="SubtreeeXPathNavigatorTests\Tests.cs">
<SubType>Code</SubType>
</Compile>
|