Example #1
0
 public override void SetPrice(Cheese cheese, DateTime currentDate)
 {
     cheese.Price = PriceCalculator.ApplyAddition(cheese, currentDate);
 }
Example #2
0
        public static bool PastBeforeDate(Cheese cheese, DateTime currentDate)
        {
            var bestBeforeDate = cheese.BestBeforeDate.HasValue ? (DateTime?)cheese.BestBeforeDate.Value.Date : null;

            return(currentDate > bestBeforeDate);
        }
Example #3
0
        public static int DaysRemainingBeforeExpiration(Cheese cheese, DateTime currentDate)
        {
            var bestBeforeDate = cheese.BestBeforeDate.HasValue ? (DateTime?)cheese.BestBeforeDate.Value.Date : null;

            return((bestBeforeDate.Value.Date - currentDate).Days);
        }
Example #4
0
 public override void SetPrice(Cheese cheese, DateTime currentDate)
 {
     cheese.Price = cheese.Price;
 }