public override void SetPrice(Cheese cheese, DateTime currentDate) { cheese.Price = PriceCalculator.ApplyAddition(cheese, currentDate); }
public static bool PastBeforeDate(Cheese cheese, DateTime currentDate) { var bestBeforeDate = cheese.BestBeforeDate.HasValue ? (DateTime?)cheese.BestBeforeDate.Value.Date : null; return(currentDate > bestBeforeDate); }
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); }
public override void SetPrice(Cheese cheese, DateTime currentDate) { cheese.Price = cheese.Price; }