From: Oleg T. <he...@us...> - 2004-10-11 20:58:32
|
Update of /cvsroot/mvp-xml/XPointer/v1/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30247/v1/test Modified Files: EntryPoint.cs XPointerReaderTests.cs XPointerTest.csproj Log Message: Added tests for schema-determined IDs. Index: XPointerReaderTests.cs =================================================================== RCS file: /cvsroot/mvp-xml/XPointer/v1/test/XPointerReaderTests.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- XPointerReaderTests.cs 9 Oct 2004 19:53:49 -0000 1.2 +++ XPointerReaderTests.cs 11 Oct 2004 20:58:00 -0000 1.3 @@ -265,7 +265,7 @@ Assert.AreEqual(xpr.ReadOuterXml(), expected); return; } - throw new InvalidOperationException("This means shorthand XPointer didn't work as expected."); + throw new InvalidOperationException("This means XPointer didn't work as expected."); } /// <summary> @@ -283,7 +283,7 @@ Assert.AreEqual(xpr.ReadOuterXml(), expected); return; } - throw new InvalidOperationException("This means shorthand XPointer didn't work as expected."); + throw new InvalidOperationException("This means XPointer didn't work as expected."); } /// <summary> @@ -301,7 +301,7 @@ Assert.AreEqual(xpr.ReadOuterXml(), expected); return; } - throw new InvalidOperationException("This means shorthand XPointer didn't work as expected."); + throw new InvalidOperationException("This means XPointer didn't work as expected."); } /// <summary> @@ -331,7 +331,7 @@ Assert.AreEqual(xpr.ReadOuterXml(), expected); return; } - throw new InvalidOperationException("This means shorthand XPointer didn't work as expected."); + throw new InvalidOperationException("This means XPointer didn't work as expected."); } /// <summary> @@ -349,7 +349,7 @@ Assert.AreEqual(xpr.ReadOuterXml(), expected); return; } - throw new InvalidOperationException("This means shorthand XPointer didn't work as expected."); + throw new InvalidOperationException("This means XPointer didn't work as expected."); } /// <summary> @@ -368,7 +368,7 @@ Assert.AreEqual(xpr.ReadOuterXml(), expected); return; } - throw new InvalidOperationException("This means shorthand XPointer didn't work as expected."); + throw new InvalidOperationException("This means XPointer didn't work as expected."); } /// <summary> @@ -386,7 +386,25 @@ Assert.AreEqual(xpr.ReadOuterXml(), expected); return; } - throw new InvalidOperationException("This means shorthand XPointer didn't work as expected."); + throw new InvalidOperationException("This means XPointer didn't work as expected."); + } + + /// <summary> + /// XSD-defined ID + /// </summary> + [Test] + public void XSDDefnedIDTest() + { + string xptr = "element(id1389/1)"; + XmlReader reader = new XmlTextReader("../../pubsNS.xml"); + XPointerReader xpr = new XPointerReader(reader, xptr, true); + string expected = @"<pub_name>Algodata Infosystems</pub_name>"; + while (xpr.Read()) + { + Assert.AreEqual(xpr.ReadOuterXml(), expected); + return; + } + throw new InvalidOperationException("This means XPointer didn't work as expected."); } } } Index: XPointerTest.csproj =================================================================== RCS file: /cvsroot/mvp-xml/XPointer/v1/test/XPointerTest.csproj,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- XPointerTest.csproj 9 Oct 2004 19:53:49 -0000 1.2 +++ XPointerTest.csproj 11 Oct 2004 20:58:00 -0000 1.3 @@ -117,6 +117,19 @@ BuildAction = "None" /> <File + RelPath = "pubNS.xsd" + BuildAction = "Content" + /> + <File + RelPath = "pubNS.xsx" + DependentUpon = "pubNS.xsd" + BuildAction = "None" + /> + <File + RelPath = "pubsNS.xml" + BuildAction = "Content" + /> + <File RelPath = "XPointerParserTests.cs" SubType = "Code" BuildAction = "Compile" Index: EntryPoint.cs =================================================================== RCS file: /cvsroot/mvp-xml/XPointer/v1/test/EntryPoint.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- EntryPoint.cs 9 Oct 2004 19:53:49 -0000 1.2 +++ EntryPoint.cs 11 Oct 2004 20:58:00 -0000 1.3 @@ -14,7 +14,7 @@ XPointerReaderTests rt = new XPointerReaderTests(); try { - rt.XPointerSchemeScalarResultTest(); + rt.XSDDefnedIDTest(); } catch (Exception e) { |