public Customer(CustomerName name, CustomerEmail email) : this() { _name = name ?? throw new ArgumentNullException(nameof(name)); _email = email ?? throw new ArgumentNullException(nameof(email)); MoneySpent = Dollars.Of(0); Status = CustomerStatus.Regular; }
public virtual Dollars CalculatePrice(CustomerStatus status) { decimal discount = status.GetDiscount; switch (LicensingModel) { case LicensingModel.TwoDays: return(Dollars.Of(ApplyDiscount(4, discount))); case LicensingModel.LifeLong: return(Dollars.Of(ApplyDiscount(8, discount))); default: throw new ArgumentOutOfRangeException(); } }
public virtual Dollars CalculatePrice(AthleteStatus athleteStatus) { decimal discountModifyer = 1 - athleteStatus.GetDiscount(); switch (LicensingModel) { case LicensingModelType.TwoDays: return(Dollars.Of(2) * discountModifyer); case LicensingModelType.ThirtyDays: return(Dollars.Of(4) * discountModifyer); case LicensingModelType.LifeLong: return(Dollars.Of(8) * discountModifyer); default: throw new ArgumentOutOfRangeException(); } }
protected override Dollars GetBasePrice() { return(Dollars.Of(4)); }