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

            _currentBalance -= selection.Price;

            return(true);
        }