Example #1
0
        public void Reset()
        {
            var terminal = new PointOfSaleTerminal(this._mockCart.Object, this._mockProductRepository.Object);

            terminal.Reset();

            this._mockCart.Verify(c => c.Clear(), Times.Once);
        }
Example #2
0
        static void Main()
        {
            var terminal = new PointOfSaleTerminal();

            SetDefaultPrices(terminal);

            Console.WriteLine("Input product names to scan");
            Console.WriteLine("Example: ABCDABA");

            do
            {
                terminal.Reset();
                ScanProducts(terminal);

                var totalPrice = terminal.CalculateTotal();

                Console.WriteLine();
                Console.WriteLine($"Total price: {totalPrice}");
                Console.WriteLine("Press ESC to exit. Press any key to scan again");
            } while (Console.ReadKey(true).Key != ConsoleKey.Escape);
        }