public void TestGetDonations()
        {
            var donations = new List<DonationDTO>
            {
                new DonationDTO
                {
                    BatchId = 123,
                    Amount = 78900,
                    DonationDate = DateTime.Now,
                    Id = "456",
                    Source = new DonationSourceDTO
                    {
                    SourceType = PaymentType.CreditCard,
                    CardType = CreditCardType.AmericanExpress,
                    Name = "ending in 1234",
                    PaymentProcessorId = "tx_123",
                    },
                    Email = "*****@*****.**",
                    ProgramId = "3",
                    Status = DonationStatus.Succeeded
                }
            };
            var dto = new DonationsDTO();
            dto.Donations.AddRange(donations);

            gatewayDonationServiceMock.Setup(mocked => mocked.GetDonationsForAuthenticatedUser(authType + " " + authToken, "1999", null, true)).Returns(dto);
            var response = fixture.GetDonations("1999", null, true);
            gatewayDonationServiceMock.VerifyAll();

            Assert.IsNotNull(response);
            Assert.IsInstanceOf<OkNegotiatedContentResult<DonationsDTO>>(response);
            var r = (OkNegotiatedContentResult<DonationsDTO>)response;
            Assert.IsNotNull(r.Content);
            Assert.AreSame(dto, r.Content);
        }
        private DonationsDTO NormalizeDonations(IList<DonationDTO> donations, int? limit = null)
        {
            foreach (var donation in donations)
            {
                if (donation.Source.SourceType != PaymentType.SoftCredit)
                {
                    var charge = GetStripeCharge(donation);
                    SetDonationSource(donation, charge);
                }

                ConfirmRefundCorrect(donation);
            }

            donations = OrderDonations(donations, limit);
            donations = LimitDonations(donations, limit);


            var donationsResponse = new DonationsDTO();

            donationsResponse.Donations.AddRange(donations);
            donationsResponse.BeginningDonationDate = donationsResponse.Donations.Last().DonationDate;
            donationsResponse.EndingDonationDate = donationsResponse.Donations.First().DonationDate;

            return donationsResponse;
        }