public void TestSimple() { RefundReversal refundReversal = new RefundReversal(); refundReversal.ID = "a"; refundReversal.ReportGroup = "b"; refundReversal.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'><refundReversalResponse><litleTxnId>123</litleTxnId></refundReversalResponse></litleOnlineResponse>"); Communications mockedCommunication = mock.Object; litle.SetCommunication(mockedCommunication); RefundReversalResponse response = litle.RefundReversal(refundReversal); Assert.AreEqual(123, response.LitleTxnId); }
public RefundReversalResponse RefundReversal(RefundReversal refundReversal) { LitleOnlineRequest request = CreateLitleOnlineRequest(); request.RefundReversal = refundReversal; LitleOnlineResponse response = SendToLitle(request); return response.RefundReversalResponse; }
public void testSpecialCharacters_RefundReversal() { var refundReversal = new RefundReversal { ID = "theId", ReportGroup = "<'&\">", CustomerId = "theCustomerId", LitleTxnId = "123" }; string actual = refundReversal.Serialize(); const string expected = @" <refundReversal id=""theId"" customerId=""theCustomerId"" reportGroup=""<'&">""> <litleTxnId>123</litleTxnId> </refundReversal>"; Assert.AreEqual(expected, actual); }
public void testRefundReversal_Full() { var refundReversal = new RefundReversal { ID = "theId", ReportGroup = "theReportGroup", CustomerId = "theCustomerId", LitleTxnId = "123" }; string actual = refundReversal.Serialize(); const string expected = @" <refundReversal id=""theId"" customerId=""theCustomerId"" reportGroup=""theReportGroup""> <litleTxnId>123</litleTxnId> </refundReversal>"; Assert.AreEqual(expected, actual); }