예제 #1
0
 public static void AssertEqualsXml(string id, XmlNode exp, XmlNode ob)
 {
     if (!AssertType(id, exp, ob))
     {
         return;
     }
     Assertion.AssertEquals(id, XmlSerializerTests.Infoset(exp), XmlSerializerTests.Infoset(ob));
 }
예제 #2
0
        public void WriteLiteral()
        {
            Test data = BuildTestObject();

            XmlSerializer           ss   = new XmlSerializer(GetLiteralTypeMapping());
            XmlSerializerNamespaces nams = new XmlSerializerNamespaces();
            StringWriter            sw   = new StringWriter();

            ss.Serialize(sw, data, nams);
            string serialized = sw.ToString();

            serialized = XmlSerializerTests.Infoset(serialized);

            StreamReader sr       = new StreamReader("Test/XmlFiles/literal-data.xml");
            string       expected = sr.ReadToEnd();

            sr.Close();

            expected = XmlSerializerTests.Infoset(expected);
            AssertEquals(expected, serialized);
        }