Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }
Exemple #4
0
        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);
        }
Exemple #5
0
        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);
        }
        public void Adjustment_20SubTotalAnd60Total_AdjustmentShouldBe40()
        {
            var summary = new BillCostings(20M, 60M);

            Assert.AreEqual(new Money(40M), summary.Adjustment);
        }
Exemple #10
0
        public void Adjustment_40SubTotalAnd5Total_AdjustmentShouldBeNegative35()
        {
            var summary = new BillCostings(40M, 5M);

            Assert.AreEqual(new Money(-35M), summary.Adjustment);
        }
Exemple #11
0
        public void Adjustment_20SubTotalAnd20Total_AdjustmentShouldBeZero()
        {
            var summary = new BillCostings(20M, 20M);

            Assert.AreEqual(Money.Zero, summary.Adjustment);
        }