public PackageBill(IEnumerable<Subscription> subscriptions, Money total) { Check.Argument.ArrayLenghtIsNotZero(subscriptions, nameof(subscriptions)); Check.Argument.IsNotNull(total, nameof(total)); this.subscriptions = subscriptions; costings = new BillCostings(subscriptions.Sum(), total); }
public CallChargesBill(IEnumerable <CallCharge> calls, Money total) { Check.Argument.IsNotNull(calls, nameof(calls)); Check.Argument.IsNotNull(total, nameof(total)); this.calls = calls; costings = new BillCostings(calls.Sum(), total); }
public CallChargesBill(IEnumerable<CallCharge> calls, Money total) { Check.Argument.IsNotNull(calls, nameof(calls)); Check.Argument.IsNotNull(total, nameof(total)); this.calls = calls; costings = new BillCostings(calls.Sum(), total); }
public SkyStoreBill(IEnumerable <SkyStorePurchase> rentals, IEnumerable <SkyStorePurchase> buyAndKeep, Money total) { Check.Argument.IsNotNull(rentals, nameof(rentals)); Check.Argument.IsNotNull(buyAndKeep, nameof(buyAndKeep)); this.rentals = rentals; this.buyAndKeep = buyAndKeep; costings = new BillCostings(rentals.Sum().Add(buyAndKeep.Sum()), total); }
public SkyStoreBill(IEnumerable<SkyStorePurchase> rentals, IEnumerable<SkyStorePurchase> buyAndKeep, Money total) { Check.Argument.IsNotNull(rentals, nameof(rentals)); Check.Argument.IsNotNull(buyAndKeep, nameof(buyAndKeep)); this.rentals = rentals; this.buyAndKeep = buyAndKeep; costings = new BillCostings(rentals.Sum().Add(buyAndKeep.Sum()), total); }
public void Adjustment_40SubTotalAnd5Total_AdjustmentShouldBeNegative35() { var summary = new BillCostings(40M, 5M); Assert.AreEqual(new Money(-35M), summary.Adjustment); }
public void Adjustment_20SubTotalAnd60Total_AdjustmentShouldBe40() { var summary = new BillCostings(20M, 60M); Assert.AreEqual(new Money(40M), summary.Adjustment); }
public void Adjustment_20SubTotalAnd20Total_AdjustmentShouldBeZero() { var summary = new BillCostings(20M, 20M); Assert.AreEqual(Money.Zero, summary.Adjustment); }