Esempio n. 1
0
 public void SelectItem(ItemQueue itemQueue)
 {
     if (itemQueue.CheckPrice() > _vendingMachine.MoneyInserted)
     {
         MachineOutput.DisplayInsufficientFundsError(itemQueue.CheckPrice() - _vendingMachine.MoneyInserted);
     }
     else
     {
         MachineOutput.DisplayDispensingItem();
         itemQueue.Status(); //FOR DEBUGGING
         _vendingMachine.Trash.AddWrapper(itemQueue.DispenseItem());
         _vendingMachine.MoneyInserted = 0;
         _vendingMachine.SetState(_vendingMachine.NoMoneyInsertedState);
     }
 }