public void ShouldCreateInvoice()
 {
     PaymentExperiment
     .For(_package, _generator)
     .CreateInvoice("07-12-2022")
     .VerifyLastInvoice((-700.0m, "01-12-2022", "07-12-2022"));
 }
 public void ShouldCreateValidRefundsAfterClaimCollectorSwitch()
 {
     PaymentExperiment
     .For(_package, _generator)
     .CreateInvoice("07-12-2022")
     .Pay()
     .UpdateReclaim(r => r.Cost = 400.0m)
     .CreateRefund()
     .Pay()
     .UpdateReclaim(r => r.ClaimCollector = ClaimCollector.Hackney)
     .CreateRefund()
     .Pay()
     .UpdateReclaim(r => r.ClaimCollector = ClaimCollector.Supplier)
     .UpdateReclaim(r => r.Cost           = 125.0m)
     .CreateRefund()
     .VerifyLastInvoice((-125.0m, "01-12-2022", "07-12-2022"))
     .Pay()
     .UpdateReclaim(r => r.Cost = 150.0m)
     .CreateRefund()
     .VerifyLastInvoice((-25.0m, "01-12-2022", "07-12-2022"))
     .Pay()
     .UpdateReclaim(r => r.Cost = 100.0m)
     .CreateRefund()
     .VerifyLastInvoice((50.0m, "01-12-2022", "07-12-2022"));
 }
 public void ShouldCreateInvoiceWhenEndDateWithinPayrunPeriod()
 {
     PaymentExperiment
     .For(_package, _generator)
     .CreateInvoice("31-01-2023")
     .VerifyLastInvoice((-3100.0m /* 4wk 3d */, "01-12-2022", "31-12-2022"));
 }
Exemplo n.º 4
0
 public void ShouldSkipFuturePayments()
 {
     PaymentExperiment
     .For(_package, _generator)
     .CreateInvoice("30-11-2022")
     .EnsureNoInvoiceGenerated();
 }
Exemplo n.º 5
0
 public void ShouldCreateInvoice()
 {
     PaymentExperiment
     .For(_package, _generator)
     .CreateInvoice("07-12-2022")
     .VerifyLastInvoice((100.0m, "01-12-2022", "31-12-2022"));     // since one off is created one time use it's range, not invoice range
 }
Exemplo n.º 6
0
        public void ShouldCreateSeparateInvoicesForAllFncRanges()
        {
            _fncPrices.First().ActiveTo = "07-12-2022".ToUtcDate();

            _fncPrices.Add(new FundedNursingCarePrice
            {
                ActiveFrom   = "08-12-2022".ToUtcDate(),
                ActiveTo     = "10-12-2022".ToUtcDate(),
                PricePerWeek = 350.0m
            });
            _fncPrices.Add(new FundedNursingCarePrice
            {
                ActiveFrom   = "11-12-2022".ToUtcDate(),
                ActiveTo     = "01-01-2200".ToUtcDate(),
                PricePerWeek = 175.0m
            });

            PaymentExperiment
            .For(_package, _generator)
            .CreateInvoice("14-12-2022")
            .VerifyLastInvoice(
                (700.0m, "01-12-2022", "07-12-2022"),
                (-700.0m, "01-12-2022", "07-12-2022"),
                (150.0m, "08-12-2022", "10-12-2022"),
                (-150.0m, "08-12-2022", "10-12-2022"),
                (100.0m, "11-12-2022", "14-12-2022"),
                (-100.0m, "11-12-2022", "14-12-2022"));
        }
Exemplo n.º 7
0
 public void ShouldCreateValidRefundsAfterClaimCollectorSwitch()
 {
     PaymentExperiment
     .For(_package, _generator)
     .CreateInvoice("14-12-2022")
     .Pay()
     .UpdateAllReclaims(r => r.StartDate = "02-12-2022".ToUtcDate())
     .CreateRefund()
     .VerifyLastInvoice(
         (100.0m, "01-12-2022", "14-12-2022"),
         (-100.0m, "01-12-2022", "14-12-2022"))
     .Pay()
     .UpdateAllReclaims(r => r.ClaimCollector = ClaimCollector.Hackney)
     .VerifyLastInvoice(     // No refund for FNC payment, just for FNC reclaim
         (-1300.0m, "01-12-2022", "14-12-2022"))
     .CreateRefund()
     .Pay()
     .UpdateAllReclaims(r => r.ClaimCollector = ClaimCollector.Supplier)
     .UpdateAllReclaims(r => r.StartDate      = "05-12-2022".ToUtcDate())
     .CreateRefund()
     .VerifyLastInvoice(
         (1000.0m, "01-12-2022", "14-12-2022"),
         (-1000.0m, "01-12-2022", "14-12-2022"))
     .Pay()
     .UpdateAllReclaims(r => r.StartDate = "01-12-2022".ToUtcDate())
     .CreateRefund()
     .VerifyLastInvoice(
         (400.0m, "01-12-2022", "14-12-2022"),
         (-400.0m, "01-12-2022", "14-12-2022"));
 }
Exemplo n.º 8
0
 public void ShouldCreateOneDayInvoiceForOngoingOneOff()
 {
     PaymentExperiment
     .For(_package, _generator)
     .UpdateDetail(d => d.EndDate = null)
     .CreateInvoice("06-12-2022")
     .VerifyLastInvoice((100.0m, "01-12-2022", "01-12-2022"));
 }
 public void ShouldSkipHackneyCareCharges()
 {
     PaymentExperiment
     .For(_package, _generator)
     .UpdateReclaim(r => r.ClaimCollector = ClaimCollector.Hackney)
     .CreateInvoice("07-12-2022")
     .EnsureNoInvoiceGenerated();
 }
 public void ShouldCreateInvoiceForPendingReclaimWithinInvoiceRange()
 {
     PaymentExperiment
     .For(_package, _generator)
     .UpdateReclaim(r => r.StartDate = "20-12-2022".ToUtcDate())
     .CreateInvoice("20-12-2022")
     .VerifyLastInvoice((-100.0m, "20-12-2022", "20-12-2022"));
 }
 public void ShouldCreateInvoiceForEndedReclaimWithinInvoiceRange()
 {
     PaymentExperiment
     .For(_package, _generator)
     .UpdateReclaim(r => r.EndDate = "01-12-2022".ToUtcDate())
     .CreateInvoice("07-12-2022")
     .VerifyLastInvoice((-100.0m, "01-12-2022", "01-12-2022"));
 }
 public void ShouldSkipInvoiceForCancelledReclaim()
 {
     PaymentExperiment
     .For(_package, _generator)
     .UpdateReclaim(r => r.Status = ReclaimStatus.Cancelled)
     .CreateInvoice("07-12-2022")
     .EnsureNoInvoiceGenerated();
 }
 public void ShouldSkipDetailsTotallyCoveredByInvoices()
 {
     PaymentExperiment
     .For(_package, _generator)
     .CreateInvoice("31-12-2022")
     .CreateInvoice("31-12-2022")
     .EnsureNoInvoiceGenerated();
 }
 public void ShouldSkipFuturePayments()
 {
     PaymentExperiment
     .For(_package, _generator)
     .UpdateReclaim(d => d.StartDate = "04-12-2022".ToUtcDate())
     .CreateInvoice("03-12-2022")
     .EnsureNoInvoiceGenerated();
 }
Exemplo n.º 15
0
 public void ShouldSkipHackneyFncReclaim()
 {
     PaymentExperiment
     .For(_package, _generator)
     .UpdateAllReclaims(r => r.ClaimCollector = ClaimCollector.Hackney)
     .CreateInvoice("14-01-2023")
     .VerifyLastInvoice((3100.0m, "01-12-2022", "31-12-2022"));
 }
 public void ShouldCreateInvoiceForOngoingWeeklyNeed()
 {
     PaymentExperiment
     .For(_package, _generator)
     .UpdateDetail(d => d.EndDate = null)
     .CreateInvoice("07-12-2022")
     .VerifyLastInvoice((700.0m, "01-12-2022", "07-12-2022"));
 }
 public void ShouldConsiderExistingInvoices()
 {
     PaymentExperiment
     .For(_package, _generator)
     .CreateInvoice("03-12-2022")
     .CreateInvoice("04-12-2022")
     .VerifyLastInvoice((-100.0m, "04-12-2022", "04-12-2022"));
 }
 public void ShouldCreateInvoiceForOngoingCareCharge()
 {
     PaymentExperiment
     .For(_package, _generator)
     .UpdateReclaim(d => d.EndDate = null)
     .CreateInvoice("07-12-2022")
     .VerifyLastInvoice((-700.0m, "01-12-2022", "07-12-2022"));
 }
 public void ShouldConsiderRejectedInvoices()
 {
     PaymentExperiment
     .For(_package, _generator)
     .CreateInvoice("03-12-2022")
     .Reject()
     .CreateInvoice("08-12-2022")
     .VerifyLastInvoice((-800.0m, "01-12-2022", "08-12-2022"));
 }
Exemplo n.º 20
0
 public void ShouldCreateJustOneInvoiceForEntireRange()
 {
     PaymentExperiment
     .For(_package, _generator)
     .CreateInvoice("06-12-2022")
     .VerifyLastInvoice((100.0m, "01-12-2022", "31-12-2022"))
     .CreateInvoice("31-01-2022")
     .EnsureNoInvoiceGenerated();     // one-off has been created already
 }
 public void ShouldCreateRefundsWhenMovingIntoPast()
 {
     PaymentExperiment
     .For(_package, _generator)
     .CreateInvoice("07-12-2022")
     .Pay()
     .UpdateReclaim(r => r.StartDate = "30-11-2022".ToUtcDate())
     .CreateRefund()     // period is extended 1 day back, cost hasn't deducted -> supplier overpaid
     .VerifyLastInvoice((-100.0m, "30-11-2022", "30-11-2022"));
 }
Exemplo n.º 22
0
 public void ShouldCreateRefundOnPriceChange()
 {
     PaymentExperiment
     .For(_package, _generator)
     .CreateInvoice("06-12-2022")
     .Pay()
     .UpdateDetail(d => d.Cost = 60.0m)
     .CreateRefund()
     .VerifyLastInvoice((-40.0m, "01-12-2022", "31-12-2022"));     // price decrease - overpaid
 }
 public void ShouldRefundEverythingOnCancellation()
 {
     PaymentExperiment
     .For(_package, _generator)
     .CreateInvoice("07-12-2022")
     .Pay()
     .UpdateReclaim(r => r.Status = ReclaimStatus.Cancelled)
     .CreateRefund()     // previous cost was deducted, so supplier was underpaid -> compensate all
     .VerifyLastInvoice((700.0m, "01-12-2022", "07-12-2022"));
 }
 public void ShouldCreateRefundOnPriceChange()
 {
     PaymentExperiment
     .For(_package, _generator)
     .CreateInvoice("07-12-2022")
     .Pay()
     .UpdateDetail(d => d.Cost = 400.0m)
     .CreateRefund()     // compensate overpaid 300
     .VerifyLastInvoice((-300.0m, "01-12-2022", "07-12-2022"));
 }
 public void ShouldCreateRefundOnEndDateChange()
 {
     PaymentExperiment
     .For(_package, _generator)
     .CreateInvoice("07-12-2022")
     .Pay()
     .UpdateReclaim(d => d.EndDate = "06-12-2022".ToUtcDate())
     .CreateRefund()
     .VerifyLastInvoice((100.0m, "01-12-2022", "07-12-2022"));
 }
 public void ShouldCreateRefundOnStartDateChange()
 {
     PaymentExperiment
     .For(_package, _generator)
     .CreateInvoice("07-12-2022")
     .Pay()
     .UpdateReclaim(r => r.StartDate = "02-12-2022".ToUtcDate())
     .CreateRefund()     // deducted for 7 days, now deducted for 6 days -> refund 100, use original invoice range
     .VerifyLastInvoice((100.0m, "01-12-2022", "07-12-2022"));
 }
 public void ShouldCreateRefundOnPriceChange()
 {
     PaymentExperiment
     .For(_package, _generator)
     .CreateInvoice("07-12-2022")
     .Pay()
     .UpdateReclaim(r => r.Cost = 400.0m)
     .CreateRefund()     // deducted 700, now should deduct just 400 -> underpaid, add 300
     .VerifyLastInvoice((300.0m, "01-12-2022", "07-12-2022"));
 }
 public void ShouldCreateRefundOnStartDateChange()
 {
     PaymentExperiment
     .For(_package, _generator)
     .CreateInvoice("07-12-2022")
     .Pay()
     .UpdateDetail(d => d.StartDate = "02-12-2022".ToUtcDate())
     .CreateRefund()
     .VerifyLastInvoice((-100.0m, "01-12-2022", "07-12-2022"));     // use original invoice range
 }
 public void ShouldCreateRefundWhenMovingIntoFuture()
 {
     PaymentExperiment
     .For(_package, _generator)
     .CreateInvoice("07-12-2022")
     .Pay()
     .UpdateReclaim(d => d.StartDate = "01-01-2023".ToUtcDate())
     .CreateRefund()     // no cost should be deducted now, supplier underpaid - compensate
     .VerifyLastInvoice((700.0m, "01-12-2022", "07-12-2022"));
 }
 public void ShouldCreateRefundWhenMovingIntoFuture()
 {
     PaymentExperiment
     .For(_package, _generator)
     .CreateInvoice("07-12-2022")
     .Pay()
     .UpdateDetail(d => d.StartDate = "01-01-2023".ToUtcDate())
     .CreateRefund()
     .VerifyLastInvoice((-700.0m, "01-12-2022", "07-12-2022"));
 }