Example #1
0
        public override int Interpret(CurrentPricesContext context)
        {
            int price = context.GetPrice("Bed");

            Console.WriteLine("Bed: {0}", price);
            return(price);
        }
Example #2
0
        private CurrentPricesContext GetRecentPricesContext()
        {
            var pricesContext = new CurrentPricesContext();

            pricesContext.SetPrice("Bed", 400);
            pricesContext.SetPrice("TV", 100);
            pricesContext.SetPrice("Laptop", 500);
            return(pricesContext);
        }
Example #3
0
 public override int Interpret(CurrentPricesContext context)
 {
     return(GoodsInside.Sum(goods => goods.Interpret(context)));
 }