public void TestRetrieveActionable()
        {
            var retrievalResponse = _retrievalRequest.RetrieveByActionable(true);

            Assert.NotNull(retrievalResponse);
            Assert.NotNull(retrievalResponse.transactionId);
            Assert.NotNull(retrievalResponse.chargebackCase);
        }
예제 #2
0
        public void TestRetrieveByActionable(bool actionable, int expectedId, int expectedNCases,
                                             bool expectedNull)
        {
            var expectedXmlResponse     = GenerateXmlResponse(expectedId, expectedNCases);
            var expectedResponseContent = new ResponseContent(
                "text/xml", ChargebackUtils.StringToBytes(expectedXmlResponse));
            var commMock = new Mock <Communication>();

            commMock.Setup(c => c.Get(string.Format("/chargebacks/?actionable={0}", actionable)))
            .Returns(expectedResponseContent);
            var request
                = new ChargebackRetrievalRequest(commMock.Object);
            var response
                = request.RetrieveByActionable(actionable);

            Assert.AreEqual(expectedId, response.transactionId);
            var nullCase = response.chargebackCase == null;

            Assert.AreEqual(expectedNull, nullCase);
            if (!nullCase)
            {
                Assert.AreEqual(expectedNCases, response.chargebackCase.Length);
            }
        }