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 void testRefundReversal_Full() { refundReversal refundReversal = new refundReversal(); refundReversal.id = "theId"; refundReversal.reportGroup = "theReportGroup"; refundReversal.customerId = "theCustomerId"; refundReversal.litleTxnId = "123"; String actual = refundReversal.Serialize(); String expected = @" <refundReversal id=""theId"" customerId=""theCustomerId"" reportGroup=""theReportGroup""> <litleTxnId>123</litleTxnId> </refundReversal>"; Assert.AreEqual(expected, actual); }
public void testSpecialCharacters_RefundReversal() { refundReversal refundReversal = new refundReversal(); refundReversal.id = "theId"; refundReversal.reportGroup = "<'&\">"; refundReversal.customerId = "theCustomerId"; refundReversal.litleTxnId = "123"; String actual = refundReversal.Serialize(); String expected = @" <refundReversal id=""theId"" customerId=""theCustomerId"" reportGroup=""<'&">""> <litleTxnId>123</litleTxnId> </refundReversal>"; Assert.AreEqual(expected, actual); }
public refundReversalResponse RefundReversal(refundReversal refundReversal) { litleOnlineRequest request = createLitleOnlineRequest(); request.refundReversal = refundReversal; litleOnlineResponse response = sendToLitle(request); refundReversalResponse refundReversalResponse = response.refundReversalResponse; return refundReversalResponse; }