示例#1
0
 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;
 }
示例#2
0
        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();
            }
        }
示例#3
0
        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();
            }
        }
示例#4
0
 protected override Dollars GetBasePrice()
 {
     return(Dollars.Of(4));
 }