public virtual void SetPrice(Cheese cheese, DateTime currentDate) { if (!IsExpired(currentDate)) { cheese.Price = PriceCalculator.ApplyDiscount(cheese, currentDate); } }
public override void SetPrice(Cheese cheese, DateTime currentDate) { if (Utils.DaysRemainingBeforeExpiration(cheese, currentDate) > 10) { cheese.Price = PriceCalculator.ApplyDiscount(cheese, currentDate); } else if (Utils.DaysRemainingBeforeExpiration(cheese, currentDate) <= 5) { cheese.Price = PriceCalculator.ApplyAddition(cheese, currentDate); } else { cheese.Price = PriceCalculator.ApplyAddition(cheese, currentDate); } }