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>"); }
public void GetSearchElementTestCase() { MyXMLClass myxml = new MyXMLClass (); var retxml = myxml.GetSearchElement (); Assert.AreEqual (retxml.ToString (), @"<id>100</id>"); }
public void GetSearchAttributeTestCase() { MyXMLClass myxml = new MyXMLClass (); var retxml = myxml.GetSearchAttribute (); Assert.AreEqual (retxml.ToString (), @"<name mail=""*****@*****.**"">foo</name>"); }
public void DeserializeXMLTestCase() { MyXMLClass myxml = new MyXMLClass (); var retxml = myxml.DeserializeXML (); Assert.IsInstanceOfType(typeof(List<MyXMLList>),retxml); }
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>"); }