public override string Serialize()
{
string xml = "\r\n<accountUpdate ";
if (id != null)
{
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>";
if (card != null)
{
xml += "\r\n<card>";
xml += card.Serialize();
xml += "\r\n</card>";
}
else if (token != null)
{
xml += "\r\n<token>";
xml += token.Serialize();
xml += "\r\n</token>";
}
xml += "\r\n</accountUpdate>";
return xml;
}
public void testAddAccountUpdate() { accountUpdate accountUpdate = new accountUpdate(); accountUpdate.reportGroup = "Planets"; accountUpdate.orderId = "12344"; cardType card = new cardType(); card.type = methodOfPaymentTypeEnum.VI; card.number = "4100000000000002"; card.expDate = "1210"; accountUpdate.card = card; batchRequest.addAccountUpdate(accountUpdate); Assert.AreEqual(1, batchRequest.getNumAccountUpdates()); mockLitleFile.Verify(litleFile => litleFile.createRandomFile(It.IsAny<String>(), It.IsAny<String>(), It.IsAny<String>(), mockLitleTime.Object)); mockLitleFile.Verify(litleFile => litleFile.AppendLineToFile(mockFilePath, accountUpdate.Serialize())); }