public void testEcheckPreNoteSale() { EcheckPreNoteSale echeckPreNoteSale = new EcheckPreNoteSale(); echeckPreNoteSale.OrderId = "12345"; echeckPreNoteSale.OrderSource = OrderSourceType.Ecommerce; EcheckType echeck = new EcheckType(); echeck.AccType = EcheckAccountTypeEnum.Checking; echeck.AccNum = "12345657890"; echeck.RoutingNum = "123456789"; echeck.CheckNum = "123455"; echeckPreNoteSale.Echeck = echeck; Contact contact = new Contact(); contact.Name = "Bob"; contact.City = "lowell"; contact.State = "MA"; contact.Email = "litle.com"; echeckPreNoteSale.BillToAddress = contact; var mockLitleResponse = new Mock<LitleResponse>(); var mockLitleXmlSerializer = new Mock<LitleXmlSerializer>(); mockXmlReader.SetupSequence(XmlReader => XmlReader.ReadOuterXml()) .Returns("<echeckPreNoteSaleResponse xmlns='http://www.litle.com/schema'><litleTxnId>123</litleTxnId></echeckPreNoteSaleResponse>") .Returns("<echeckPreNoteSaleResponse xmlns='http://www.litle.com/schema'><litleTxnId>124</litleTxnId></echeckPreNoteSaleResponse>"); BatchResponse mockedLitleBatchResponse = new BatchResponse(); mockedLitleBatchResponse.SetEcheckPreNoteSaleResponseReader(mockXmlReader.Object); mockLitleResponse.Setup(litleResponse => litleResponse.NextBatchResponse()).Returns(mockedLitleBatchResponse); LitleResponse mockedLitleResponse = mockLitleResponse.Object; Communications mockedCommunications = mockCommunications.Object; mockLitleXmlSerializer.Setup(litleXmlSerializer => litleXmlSerializer.DeserializeObjectFromFile(It.IsAny<String>())).Returns(mockedLitleResponse); LitleXmlSerializer mockedLitleXmlSerializer = mockLitleXmlSerializer.Object; LitleFile mockedLitleFile = mockLitleFile.Object; litle.SetCommunication(mockedCommunications); litle.SetLitleXmlSerializer(mockedLitleXmlSerializer); litle.SetLitleFile(mockedLitleFile); litle.SetLitleTime(mockLitleTime.Object); BatchRequest litleBatchRequest = new BatchRequest(); litleBatchRequest.SetLitleFile(mockedLitleFile); litleBatchRequest.SetLitleTime(mockLitleTime.Object); litleBatchRequest.AddEcheckPreNoteSale(echeckPreNoteSale); litleBatchRequest.AddEcheckPreNoteSale(echeckPreNoteSale); litle.AddBatch(litleBatchRequest); string batchFileName = litle.SendToLitle(); LitleResponse actualLitleResponse = litle.ReceiveFromLitle(batchFileName); BatchResponse actualLitleBatchResponse = actualLitleResponse.NextBatchResponse(); EcheckPreNoteSaleResponse actualEcheckPreNoteSaleResponse1 = actualLitleBatchResponse.NextEcheckPreNoteSaleResponse(); EcheckPreNoteSaleResponse actualEcheckPreNoteSaleResponse2 = actualLitleBatchResponse.NextEcheckPreNoteSaleResponse(); EcheckPreNoteSaleResponse nullEcheckPreNoteSalesResponse = actualLitleBatchResponse.NextEcheckPreNoteSaleResponse(); Assert.AreEqual(123, actualEcheckPreNoteSaleResponse1.LitleTxnId); Assert.AreEqual(124, actualEcheckPreNoteSaleResponse2.LitleTxnId); Assert.IsNull(nullEcheckPreNoteSalesResponse); 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)); }