public void TestUnload() { var unload = new unload(); unload.amount = 700; unload.orderSource = orderSourceType.ecommerce; unload.card = new giftCardCardType(); batchRequest.addUnload(unload); Assert.AreEqual(1, batchRequest.getNumUnloads()); Assert.AreEqual(700, batchRequest.getUnloadAmount()); mockCnpFile.Verify(cnpFile => cnpFile.createRandomFile(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), mockCnpTime.Object)); mockCnpFile.Verify(cnpFile => cnpFile.AppendLineToFile(mockFilePath, unload.Serialize())); }
public void testUnload_OnlyRequired() { unload unload = new unload(); unload.orderId = "12345"; unload.amount = 200; unload.orderSource = orderSourceType.ecommerce; unload.card = new giftCardCardType(); unload.id = "theId"; unload.reportGroup = "theReportGroup"; String actual = unload.Serialize(); String expected = @" <unload id=""theId"" reportGroup=""theReportGroup""> <orderId>12345</orderId> <amount>200</amount> <orderSource>ecommerce</orderSource> <card> <type>MC</type> </card> </unload>"; Assert.AreEqual(Regex.Replace(expected, @"\s+", String.Empty), Regex.Replace(actual, @"\s+", String.Empty)); }
public void testUnload_Full() { unload unload = new unload(); unload.orderId = "12345"; unload.amount = 200; unload.orderSource = orderSourceType.ecommerce; unload.card = new cardType(); unload.id = "theId"; unload.reportGroup = "theReportGroup"; String actual = unload.Serialize(); String expected = @" <unload id=""theId"" reportGroup=""theReportGroup""> <orderId>12345</orderId> <amount>200</amount> <orderSource>ecommerce</orderSource> <card> <type>MC</type> </card> </unload>"; Assert.AreEqual(expected, actual); }
public void testUnload_OnlyRequired() { unload unload = new unload(); unload.orderId = "12345"; unload.amount = 200; unload.orderSource = orderSourceType.ecommerce; unload.card = new cardType(); unload.id = "theId"; unload.reportGroup = "theReportGroup"; String actual = unload.Serialize(); String expected = @" <unload id=""theId"" reportGroup=""theReportGroup""> <orderId>12345</orderId> <amount>200</amount> <orderSource>ecommerce</orderSource> <card> <type>MC</type> </card> </unload>"; Assert.AreEqual(expected, actual); }
public void TestUnload() { var unload = new unload(); unload.amount = 700; unload.orderSource = orderSourceType.ecommerce; unload.card = new cardType(); _batchRequest.addUnload(unload); Assert.AreEqual(1, _batchRequest.getNumUnloads()); Assert.AreEqual(700, _batchRequest.getUnloadAmount()); _mockLitleFile.Verify(litleFile => litleFile.createRandomFile(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), _mockLitleTime.Object)); _mockLitleFile.Verify(litleFile => litleFile.AppendLineToFile(MockFilePath, unload.Serialize())); }
public void testUnload() { unload unload = new unload(); unload.amount = 700; unload.orderSource = orderSourceType.ecommerce; unload.card = new cardType(); batchRequest.addUnload(unload); Assert.AreEqual(1, batchRequest.getNumUnloads()); Assert.AreEqual(700, batchRequest.getUnloadAmount()); mockLitleFile.Verify(litleFile => litleFile.createRandomFile(It.IsAny<String>(), It.IsAny<String>(), It.IsAny<String>(), mockLitleTime.Object)); mockLitleFile.Verify(litleFile => litleFile.AppendLineToFile(mockFilePath, unload.Serialize())); }