public void List() { var dummies = new List <Dummy> { new Dummy(1), new Dummy(1) }; var xml = XmlSerializerAssert.ToXml(dummies) .Escape(); Console.Write(xml); }
public void TestName() { ////var xml = "<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n" + //// "<Dummy xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n" + //// " <Value>2</Value>\r\n" + //// "</Dummy>"; var dummy = new Dummy(2); var escape = XmlSerializerAssert.ToXml(dummy).Escape(); Console.WriteLine(escape); }
public void ToXml() { var dummy = new Dummy { Value = 2 }; var xml = XmlSerializerAssert.ToXml(dummy); Console.Write(xml); var expected = "<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n" + "<Dummy xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n" + " <Value>2</Value>\r\n" + "</Dummy>"; Assert.AreEqual(expected, xml); }