Ejemplo n.º 1
0
        public void Refund(int currentTotal, int?priceInCents)
        {
            var calculator = new RefundCalculator();
            var refund     = calculator.CalculateRefund(priceInCents ?? 0, currentTotal);

            foreach (var coinCount in refund)
            {
                ReturnTray.AddRange(Enumerable.Repeat(coinCount.Key, coinCount.Value));
            }
        }
Ejemplo n.º 2
0
 public void ReturnCoins()
 {
     ReturnTray.AddRange(CoinSlot);
     CoinSlot.Clear();
     Context.State = new NoMoneyState(this);
 }