예제 #1
0
 public void GetMyXMLTestCase()
 {
     MyXMLClass myxml = new MyXMLClass ();
     var retxml = myxml.GetXMLDocument ();
     Assert.AreEqual (retxml.ToString().Replace("\r",""), @"<myxmls>
       <myxml>
     <id>100</id>
     <name mail=""*****@*****.**"">hoge</name>
       </myxml>
       <myxml>
     <id>200</id>
     <name mail=""*****@*****.**"">bar</name>
       </myxml>
       <myxml>
     <id>300</id>
     <name mail=""*****@*****.**"">foo</name>
       </myxml>
     </myxmls>");
 }
예제 #2
0
 public void GetSearchElementTestCase()
 {
     MyXMLClass myxml = new MyXMLClass ();
     var retxml = myxml.GetSearchElement ();
     Assert.AreEqual (retxml.ToString (), @"<id>100</id>");
 }
예제 #3
0
 public void GetSearchAttributeTestCase()
 {
     MyXMLClass myxml = new MyXMLClass ();
     var retxml = myxml.GetSearchAttribute ();
     Assert.AreEqual (retxml.ToString (), @"<name mail=""*****@*****.**"">foo</name>");
 }
예제 #4
0
 public void DeserializeXMLTestCase()
 {
     MyXMLClass myxml = new MyXMLClass ();
     var retxml = myxml.DeserializeXML ();
     Assert.IsInstanceOfType(typeof(List<MyXMLList>),retxml);
 }
예제 #5
0
 public void SerializeXMLTestCase()
 {
     MyXMLClass myxml = new MyXMLClass ();
     var retxml = myxml.SerializeXML ();
     Assert.AreEqual (retxml, @"<?xml version=""1.0"" encoding=""utf-16""?>
     <ArrayOfMyXMLList xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
       <MyXMLList>
     <Id>100</Id>
     <Name>hoge</Name>
     <Mail>[email protected]</Mail>
       </MyXMLList>
       <MyXMLList>
     <Id>200</Id>
     <Name>bar</Name>
     <Mail>[email protected]</Mail>
       </MyXMLList>
       <MyXMLList>
     <Id>300</Id>
     <Name>foo</Name>
     <Mail>[email protected]</Mail>
       </MyXMLList>
     </ArrayOfMyXMLList>");
 }