Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 6
0
        public void Adjustment_40SubTotalAnd5Total_AdjustmentShouldBeNegative35()
        {
            var summary = new BillCostings(40M, 5M);

            Assert.AreEqual(new Money(-35M), summary.Adjustment);
        }
Exemplo n.º 7
0
        public void Adjustment_20SubTotalAnd60Total_AdjustmentShouldBe40()
        {
            var summary = new BillCostings(20M, 60M);

            Assert.AreEqual(new Money(40M), summary.Adjustment);
        }
Exemplo n.º 8
0
        public void Adjustment_20SubTotalAnd20Total_AdjustmentShouldBeZero()
        {
            var summary = new BillCostings(20M, 20M);

            Assert.AreEqual(Money.Zero, summary.Adjustment);
        }
Exemplo n.º 9
0
        public void Adjustment_20SubTotalAnd60Total_AdjustmentShouldBe40()
        {
            var summary = new BillCostings(20M, 60M);

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

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

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