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

            _currentBalance -= selection.Price;

            return(true);
        }