Наследование: transactionTypeWithReportGroup
        public void TestSimple()
        {
            deactivateReversal deactivateReversal = new deactivateReversal();
            deactivateReversal.id = "a";
            deactivateReversal.reportGroup = "b";
            deactivateReversal.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'><deactivateReversalResponse><litleTxnId>123</litleTxnId></deactivateReversalResponse></litleOnlineResponse>");

            Communications mockedCommunication = mock.Object;
            litle.setCommunication(mockedCommunication);
            deactivateReversalResponse response = litle.DeactivateReversal(deactivateReversal);
            Assert.AreEqual("123", response.litleTxnId);
        }
        public void testDeactivateReversal_Full()
        {
            deactivateReversal deactivateReversal = new deactivateReversal();
            deactivateReversal.id = "theId";
            deactivateReversal.reportGroup = "theReportGroup";
            deactivateReversal.customerId = "theCustomerId";
            deactivateReversal.litleTxnId = "123";

            String actual = deactivateReversal.Serialize();
            String expected = @"
            <deactivateReversal id=""theId"" customerId=""theCustomerId"" reportGroup=""theReportGroup"">
            <litleTxnId>123</litleTxnId>
            </deactivateReversal>";
            Assert.AreEqual(expected, actual);
        }
Пример #3
0
        public deactivateReversalResponse DeactivateReversal(deactivateReversal deactivateReversal)
        {
            litleOnlineRequest request = createLitleOnlineRequest();
            request.deactivateReversal = deactivateReversal;

            litleOnlineResponse response = sendToLitle(request);
            deactivateReversalResponse deactivateReversalResponse = response.deactivateReversalResponse;
            return deactivateReversalResponse;
        }