public void DeactivateReversal()
        {
            deactivateReversal reversal = new deactivateReversal();

            reversal.id          = "1";
            reversal.reportGroup = "planets";
            reversal.litleTxnId  = 123456000;
            giftCardCardType card = new giftCardCardType();

            card.type                       = methodOfPaymentTypeEnum.GC;
            card.number                     = "414100000000000000";
            card.expDate                    = "1210";
            card.pin                        = "1234";
            reversal.card                   = card;
            reversal.originalRefCode        = "123";
            reversal.originalTxnTime        = new DateTime(2017, 01, 01);
            reversal.originalSystemTraceId  = 123;
            reversal.originalSequenceNumber = "123456";

            var mock = new Mock <Communications>();

            mock.Setup(Communications => Communications.HttpPost(It.IsRegex(".*<litleTxnId>123456000</litleTxnId>\r\n<card>\r\n<type>GC</type>\r\n<number>414100000000000000</number>\r\n<expDate>1210</expDate>\r\n<pin>1234</pin>\r\n</card>\r\n<originalRefCode>123</originalRefCode>\r\n<originalTxnTime>2017-01-01T00:00:00Z</originalTxnTime>\r\n<originalSystemTraceId>123</originalSystemTraceId>\r\n<originalSequenceNumber>123456</originalSequenceNumber>.*", RegexOptions.Singleline), It.IsAny <Dictionary <String, String> >()))
            .Returns("<litleOnlineResponse version='8.14' response='0' message='Valid Format' xmlns='http://www.litle.com/schema'><authReversalResponse><litleTxnId>123</litleTxnId></authReversalResponse></litleOnlineResponse>");

            Communications mockedCommunication = mock.Object;

            litle.setCommunication(mockedCommunication);
            litle.DeactivateReversal(reversal);
        }
        public void DeactivateReversal()
        {
            var reversal = new deactivateReversal
            {
                id          = "1",
                reportGroup = "planets",
                litleTxnId  = 123456000,
                card        = new giftCardCardType
                {
                    type    = methodOfPaymentTypeEnum.GC,
                    number  = "414100000000000000",
                    expDate = "1210",
                    pin     = "1234"
                },


                originalRefCode        = "123",
                originalTxnTime        = DateTime.Now,
                originalSystemTraceId  = 123,
                originalSequenceNumber = "123456"
            };

            var response = _litle.DeactivateReversal(reversal);

            Assert.AreEqual("Approved", response.message);
        }
Esempio n. 3
0
        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);
        }