public override string Serialize()
{
string xml = "\r\n<deactivate";
xml += " id=\"" + SecurityElement.Escape(id) + "\"";
if (customerId != null)
{
xml += " customerId=\"" + SecurityElement.Escape(customerId) + "\"";
}
xml += " reportGroup=\"" + SecurityElement.Escape(reportGroup) + "\">";
xml += "\r\n<orderId>" + SecurityElement.Escape(orderId) + "</orderId>";
xml += "\r\n<orderSource>" + orderSource.Serialize() + "</orderSource>";
xml += "\r\n<card>" + card.Serialize() + "\r\n</card>";
xml += "\r\n</deactivate>";
return xml;
}
public void testDeactivate_OnlyRequired() { deactivate deactivate = new deactivate(); deactivate.orderId = "12345"; deactivate.orderSource = orderSourceType.ecommerce; deactivate.card = new cardType(); deactivate.id = "theId"; deactivate.reportGroup = "theReportGroup"; String actual = deactivate.Serialize(); String expected = @" <deactivate id=""theId"" reportGroup=""theReportGroup""> <orderId>12345</orderId> <orderSource>ecommerce</orderSource> <card> <type>MC</type> </card> </deactivate>"; Assert.AreEqual(expected, actual); }