Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #6
0
        public void Adjustment_40SubTotalAnd5Total_AdjustmentShouldBeNegative35()
        {
            var summary = new BillCostings(40M, 5M);

            Assert.AreEqual(new Money(-35M), summary.Adjustment);
        }
Пример #7
0
        public void Adjustment_20SubTotalAnd60Total_AdjustmentShouldBe40()
        {
            var summary = new BillCostings(20M, 60M);

            Assert.AreEqual(new Money(40M), summary.Adjustment);
        }
Пример #8
0
        public void Adjustment_20SubTotalAnd20Total_AdjustmentShouldBeZero()
        {
            var summary = new BillCostings(20M, 20M);

            Assert.AreEqual(Money.Zero, summary.Adjustment);
        }
Пример #9
0
        public void Adjustment_20SubTotalAnd60Total_AdjustmentShouldBe40()
        {
            var summary = new BillCostings(20M, 60M);

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

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

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