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 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; }
public Money Subtract(Money money) { Check.Argument.IsNotNull(money, nameof(money)); return new Money(Value - money.Value); }
public Money Add(Money money) { Check.Argument.IsNotNull(money, nameof(money)); return new Money(Value + money.Value); }