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)); }
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); }