Esempio n. 1
0
 public void MakeSelection(VendingSelection selection)
 {
     if (_moneyBox.TryDebitBalalnce(selection))
     {
         TakeOutTray.Add(selection.CreateItem());
     }
 }
Esempio n. 2
0
        public bool TryDebitBalalnce(VendingSelection selection)
        {
            if (_currentBalance < selection.Price)
            {
                return(false);
            }

            _currentBalance -= selection.Price;

            return(true);
        }