public void testAccountUpdate() { var accountUpdate = new accountUpdate(); accountUpdate.reportGroup = "Planets"; accountUpdate.orderId = "12344"; var card = new cardType(); card.type = methodOfPaymentTypeEnum.VI; card.number = "4100000000000002"; card.expDate = "1210"; accountUpdate.card = card; var mockLitleResponse = new Mock<litleResponse>(); var mockLitleXmlSerializer = new Mock<litleXmlSerializer>(); mockXmlReader.SetupSequence(XmlReader => XmlReader.ReadOuterXml()) .Returns( "<accountUpdateResponse reportGroup=\"Merch01ReportGrp\" xmlns=\"http://www.litle.com/schema\"><litleTxnId>123</litleTxnId><orderId>MERCH01-0002</orderId><response>000</response><responseTime>2010-04-11T15:44:26</responseTime><message>Approved</message></accountUpdateResponse>") .Returns( "<accountUpdateResponse reportGroup=\"Merch01ReportGrp\" xmlns=\"http://www.litle.com/schema\"><litleTxnId>124</litleTxnId><orderId>MERCH01-0002</orderId><response>000</response><responseTime>2010-04-11T15:44:26</responseTime><message>Approved</message></accountUpdateResponse>"); var mockLitleBatchResponse = new batchResponse(); mockLitleBatchResponse.setAccountUpdateResponseReader(mockXmlReader.Object); mockLitleResponse.Setup(litleResponse => litleResponse.nextBatchResponse()).Returns(mockLitleBatchResponse); var mockedLitleResponse = mockLitleResponse.Object; var mockedCommunication = mockCommunications.Object; litle.setCommunication(mockedCommunication); mockLitleXmlSerializer.Setup( litleXmlSerializer => litleXmlSerializer.DeserializeObjectFromString(It.IsAny<string>())) .Returns(mockedLitleResponse); var mockedLitleXmlSerializer = mockLitleXmlSerializer.Object; litle.setLitleXmlSerializer(mockedLitleXmlSerializer); var mockedLitleFile = mockLitleFile.Object; litle.setLitleFile(mockedLitleFile); litle.setLitleTime(mockLitleTime.Object); var litleBatchRequest = new batchRequest(_mockCache.Object); litleBatchRequest.setLitleFile(mockedLitleFile); litleBatchRequest.setLitleTime(mockLitleTime.Object); litleBatchRequest.addAccountUpdate(accountUpdate); litleBatchRequest.addAccountUpdate(accountUpdate); litle.addBatch(litleBatchRequest); var batchFileName = litle.sendToLitle(); var actualLitleResponse = litle.receiveFromLitle(batchFileName); var actualLitleBatchResponse = actualLitleResponse.nextBatchResponse(); var actualAccountUpdateResponse1 = actualLitleBatchResponse.nextAccountUpdateResponse(); var actualAccountUpdateResponse2 = actualLitleBatchResponse.nextAccountUpdateResponse(); var nullAccountUpdateResponse = actualLitleBatchResponse.nextAccountUpdateResponse(); Assert.AreEqual(123, actualAccountUpdateResponse1.litleTxnId); Assert.AreEqual("000", actualAccountUpdateResponse1.response); Assert.AreEqual(124, actualAccountUpdateResponse2.litleTxnId); Assert.AreEqual("000", actualAccountUpdateResponse2.response); Assert.IsNull(nullAccountUpdateResponse); mockCommunications.Verify( Communications => Communications.FtpDropOff(It.IsAny<string>(), mockFileName, It.IsAny<Dictionary<string, string>>())); mockCommunications.Verify( Communications => Communications.FtpPickUp(It.IsAny<string>(), It.IsAny<Dictionary<string, string>>(), mockFileName)); }