PageRenderTime 43ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XNodeNavigatorTest.cs

https://bitbucket.org/steenlund/mono-2.6.7-for-amiga
C# | 69 lines | 13 code | 3 blank | 53 comment | 0 complexity | f1d4f7c8b03be1780fcb8cea9d9a023a MD5 | raw file
Possible License(s): LGPL-2.0, MPL-2.0-no-copyleft-exception, CC-BY-SA-3.0, GPL-2.0, LGPL-2.1
  1. //
  2. // Authors:
  3. // Atsushi Enomoto
  4. //
  5. // Copyright 2007 Novell (http://www.novell.com)
  6. //
  7. // Permission is hereby granted, free of charge, to any person obtaining
  8. // a copy of this software and associated documentation files (the
  9. // "Software"), to deal in the Software without restriction, including
  10. // without limitation the rights to use, copy, modify, merge, publish,
  11. // distribute, sublicense, and/or sell copies of the Software, and to
  12. // permit persons to whom the Software is furnished to do so, subject to
  13. // the following conditions:
  14. //
  15. // The above copyright notice and this permission notice shall be
  16. // included in all copies or substantial portions of the Software.
  17. //
  18. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  19. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  20. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  21. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  22. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  23. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  24. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  25. //
  26. using System;
  27. using System.IO;
  28. using System.Xml;
  29. using System.Xml.Linq;
  30. using System.Xml.XPath;
  31. using NUnit.Framework;
  32. namespace MonoTests.System.Xml.Linq
  33. {
  34. [TestFixture]
  35. public class XNodeNavigatorTest
  36. {
  37. /* It does not compile probably due to bug #359733.
  38. [Test]
  39. public void MoveToNext ()
  40. {
  41. XElement a = new XElement ("root",
  42. new XElement ("a"),
  43. new XElement ("B"));
  44. XPathNavigator nav = a.CreateNavigator ();
  45. Assert.IsTrue (nav.MoveToFirstChild (), "#1");
  46. Assert.IsTrue (nav.MoveToNext (), "#2");
  47. }
  48. [Test]
  49. public void MoveToId () // Not supported
  50. {
  51. string xml = @"
  52. <!DOCTYPE root [
  53. <!ELEMENT foo EMPTY>
  54. <!ELEMENT bar EMPTY>
  55. <!ATTLIST foo id ID #IMPLIED>
  56. <!ATTLIST bar id ID #IMPLIED>
  57. ]>
  58. <root><foo id='foo' /><bar id='bar' /></root>",
  59. XDocument doc = XDocument.Parse (xml, LoadOptions.SetLineInfo);
  60. XPathNavigator nav = doc.CreateNavigator ();
  61. nav.MoveToId ("foo");
  62. }
  63. */
  64. }
  65. }