Пример #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 CallCharge(TelephoneNumber called, TimeSpan duration, Money cost)
        {
            Check.Argument.IsNotNull(called, nameof(called));
            Check.Argument.IsNotNull(cost, nameof(cost));

            this.called = called;
            this.duration = duration;
            this.cost = cost;
        }
Пример #3
0
        public Money Subtract(Money money)
        {
            Check.Argument.IsNotNull(money, nameof(money));

            return new Money(Value - money.Value);
        }
Пример #4
0
        public Money Add(Money money)
        {
            Check.Argument.IsNotNull(money, nameof(money));

            return new Money(Value + money.Value);
        }