public void TestRetrieveByActivityDateWithFinancialImpact()
        {
            var retrievalResponse =
                _retrievalRequest.RetrieveByActivityDateWithImpact(new DateTime(2013, 1, 1), true);

            Assert.NotNull(retrievalResponse);
            Assert.NotNull(retrievalResponse.transactionId);
            Assert.NotNull(retrievalResponse.chargebackCase);
        }
示例#2
0
        public void TestRetrieveByActivityDateWithImpact(string date, bool impact,
                                                         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/?date={0}&financialOnly={1}", date, impact)))
            .Returns(expectedResponseContent);
            var request
                = new ChargebackRetrievalRequest(commMock.Object);
            var response
                = request.RetrieveByActivityDateWithImpact(ChargebackUtils.ParseDate(date), impact);

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

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