dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/tests/System.Xml TestXmlDocument.cs,


From: Adam Ballai <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/tests/System.Xml TestXmlDocument.cs,1.2,1.3
Date: Mon, 31 Mar 2003 19:36:52 -0500

Update of /cvsroot/dotgnu-pnet/pnetlib/tests/System.Xml
In directory subversions:/tmp/cvs-serv1492/tests/System.Xml

Modified Files:
        TestXmlDocument.cs 
Log Message:
fix for bug(3012) and more implementing

Index: TestXmlDocument.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/tests/System.Xml/TestXmlDocument.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** TestXmlDocument.cs  6 Dec 2002 04:58:32 -0000       1.2
--- TestXmlDocument.cs  1 Apr 2003 00:36:50 -0000       1.3
***************
*** 21,24 ****
--- 21,25 ----
  using CSUnit;
  using System;
+ using System.IO;
  using System.Xml;
  
***************
*** 46,49 ****
--- 47,52 ----
                        }
  
+       public string xmlASCII = "<UI version=\"3.1\" 
stdsetdef=\"1\"><class>Form1</class><widget class=\"QDialog\"><property 
name=\"name\"><cstring>Form1</cstring></property><property 
name=\"geometry\"><rect><x>0</x><y>0</y><width>179</width><height>158</height></rect></property><property
 name=\"caption\"><string>Form1</string></property></widget></UI>";
+               
        // Test document construction.
        public void TestXmlDocumentConstruct()
***************
*** 293,296 ****
--- 296,313 ----
                                // Adding a document type before should succeed.
                                doc.InsertBefore(type, element);
+                       }
+       
+       // Test searching children ie: doc["elementname"]
+       public void TestXmlDocumentFindElement()
+                       {
+                               XmlDocument doc = new XmlDocument();
+                               doc.Load( new StringReader(xmlASCII) );
+                               XmlElement e = doc["UI"];
+                               AssertEquals("XmlFindElement (1)", "UI", 
e.Name);
+                               AssertEquals("XmlFindElement (2)", "Form1", 
e["class"].InnerText);
+                               AssertEquals("XmlFindElement (3)", "Form1", 
e["widget"]["property"].InnerText);
+                               
+                               XmlElement n = doc["notgonnabefound"];
+                               AssertNull("XmlFindElement (2)", n);
                        }
  





reply via email to

[Prev in Thread] Current Thread [Next in Thread]