public decimal GetValueOfCoinReturn() { decimal value = 0; foreach (var coin in _coinReturn) { value += CoinHelper.GetCoinValue(coin); } return(value); }
public void InsertCoin(string coinName) { var coinValue = CoinHelper.GetCoinValue(coinName); if (coinValue > 0) { _insertedCoins.Add(coinName); CreditValue += coinValue; TryToDispenseProduct(); } else { _coinReturn.Add(coinName); } }