Exemple #1
0
    public void LoadXmlFromFileTest()
    {
        XmlTestInfo info = XmlUtil.LoadXmlFromFile <XmlTestInfo>("XmlTestInfo");

        Assert.NotNull(info);
        Assert.AreEqual(100, info.IntVal);
    }
Exemple #2
0
    public void LoadXmlFromStringTest()
    {
        string      xmlString = @"<root>
  <intVal>100</intVal>
</root>";
        XmlTestInfo info      = XmlUtil.LoadXmlFromString <XmlTestInfo>(xmlString);

        Assert.NotNull(info);
        Assert.AreEqual(100, info.IntVal);
    }
Exemple #3
0
    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);
    }