public void LoadXmlFromFileTest() { XmlTestInfo info = XmlUtil.LoadXmlFromFile <XmlTestInfo>("XmlTestInfo"); Assert.NotNull(info); Assert.AreEqual(100, info.IntVal); }
public void LoadXmlFromStringTest() { string xmlString = @"<root> <intVal>100</intVal> </root>"; XmlTestInfo info = XmlUtil.LoadXmlFromString <XmlTestInfo>(xmlString); Assert.NotNull(info); Assert.AreEqual(100, info.IntVal); }
public void SaveXmlToStringTest() { XmlTestInfo info = new XmlTestInfo(); info.IntVal = 100; const string expectedXmlString = @"<root> <intVal>100</intVal> </root>"; string xmlString = XmlUtil.SaveXmlToString(info); Assert.AreEqual(expectedXmlString, xmlString); }