public void Search_withEmptyResult()
        {
            DisputeSearchRequest request = new DisputeSearchRequest().
                Id.Is("non_existent_dispute");
            PaginatedCollection<Dispute> disputeCollection = gateway.Dispute.Search(request);

            var disputes = new List<Dispute>();
            foreach (var d in disputeCollection)
            {
                disputes.Add(d);
            }
            Assert.AreEqual(0, disputes.Count);
        }
        public void Search_byIdReturnsSingleDispute()
        {
            DisputeSearchRequest request = new DisputeSearchRequest().
                Id.Is("open_dispute");
            PaginatedCollection<Dispute> disputeCollection = gateway.Dispute.Search(request);

            var disputes = new List<Dispute>();
            foreach (var d in disputeCollection)
            {
                disputes.Add(d);
            }
            Assert.AreEqual(1, disputes.Count);
        }
        public void Search_withMultipleReasonsReturnsMultipleDisputes()
        {
            DisputeSearchRequest request = new DisputeSearchRequest().
                DisputeReason.IncludedIn(DisputeReason.PRODUCT_UNSATISFACTORY, DisputeReason.RETRIEVAL);
            PaginatedCollection<Dispute> disputeCollection = gateway.Dispute.Search(request);

            var disputes = new List<Dispute>();
            foreach (var d in disputeCollection)
            {
                disputes.Add(d);
            }
            Assert.AreEqual(2, disputes.Count);
        }
Exemplo n.º 4
0
        public void Search_effectiveDateRangeReturnsDispute()
        {
            DateTime startDate = DateTime.Parse("2014-03-03");
            DateTime endDate = DateTime.Parse("2014-03-05");
            DisputeSearchRequest request = new DisputeSearchRequest().
                EffectiveDate.Between(startDate, endDate);
            PaginatedCollection<Dispute> disputeCollection = gateway.Dispute.Search(request);

            var disputes = new List<Dispute>();
            foreach (var d in disputeCollection)
            {
                disputes.Add(d);
            }
            Assert.IsTrue(disputes.Count >= 1);
            Assert.AreEqual("2014", disputes[0].StatusHistory[0].EffectiveDate.Value.Year.ToString());
            Assert.AreEqual("3", disputes[0].StatusHistory[0].EffectiveDate.Value.Month.ToString());
            Assert.AreEqual("4", disputes[0].StatusHistory[0].EffectiveDate.Value.Day.ToString());
        }