public void TestSimple() { DepositReversal depositReversal = new DepositReversal(); depositReversal.ID = "a"; depositReversal.ReportGroup = "b"; depositReversal.LitleTxnId = "123"; var mock = new Mock<Communications>(); mock.Setup(Communications => Communications.HttpPost(It.IsRegex(".*<litleTxnId>123</litleTxnId>.*", RegexOptions.Singleline), It.IsAny<Dictionary<String, String>>())) .Returns("<litleOnlineResponse version='8.22' response='0' message='Valid Format' xmlns='http://www.litle.com/schema'><depositReversalResponse><litleTxnId>123</litleTxnId></depositReversalResponse></litleOnlineResponse>"); Communications mockedCommunication = mock.Object; litle.SetCommunication(mockedCommunication); DepositReversalResponse response = litle.DepositReversal(depositReversal); Assert.AreEqual(123, response.LitleTxnId); }
public DepositReversalResponse DepositReversal(DepositReversal depositReversal) { LitleOnlineRequest request = CreateLitleOnlineRequest(); request.DepositReversal = depositReversal; LitleOnlineResponse response = SendToLitle(request); return response.DepositReversalResponse; }
public void testDepositReversal_Full() { var depositReversal = new DepositReversal { ID = "theId", ReportGroup = "theReportGroup", CustomerId = "theCustomerId", LitleTxnId = "123" }; string actual = depositReversal.Serialize(); const string expected = @" <depositReversal id=""theId"" customerId=""theCustomerId"" reportGroup=""theReportGroup""> <litleTxnId>123</litleTxnId> </depositReversal>"; Assert.AreEqual(expected, actual); }