Пример #1
0
        public void ShowInsertCoinUi()
        {
            Console.WriteLine("");
            Console.WriteLine("");


            if (_coinValidator.GetCurrentTransactionTotal() > 0)
            {
                _display.CurrentTotalMessage(_coinValidator.GetCurrentTransactionTotal());
            }
            else if (!_coinBank.CanMakeChange())
            {
                _display.ExactChangeMessage();
            }
            else
            {
                _display.InsertCoinMessage();
            }


            Console.WriteLine("");
            Console.WriteLine("You rummage through your pockets looking for a ");
            Console.WriteLine("(Q)uarter" + ", " + "(N)ickel" + ", or " + "(D)ime");
            Console.WriteLine("");
            Console.WriteLine("What will you insert in the coin slot?");

            _showInsertCoinUiWasCalled = true;

            _entry = _console.ReadLine();
            if (_entry == "DISPLAY")
            {
                ShowDisplayUi();
            }
            else
            {
                _coinSlot.ReceiveCoinAndSendToValidator(_entry);
                ShowInsertMoreCoinsUi();
            }
        }