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

            return(currentDate > bestBeforeDate);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
 public override void SetPrice(Cheese cheese, DateTime currentDate)
 {
     cheese.Price = cheese.Price;
 }