Example #1
0
        public async static Task Main(string[] args)
        {
            var cartCommand  = new CartCommand(new CartCommandHandler());
            var orderCommand = new OrderCommand(new OrderCommandHandler());
            var store        = new Store(cartCommand, orderCommand);

            await store.AddToCart(1, 2);

            await store.PlaceOrder(3, 4);

            Console.ReadKey();
        }
Example #2
0
 public void ExecuteCommand(OrderCommand command, MenuItem item)
 {
     command.Execute(this.currentItems, item);
 }
Example #3
0
 public void SetCommand(int commandOption)
 {
     _orderCommand = new CommandFactory().GetCommand(commandOption);
 }