示例#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));
            }
        }
示例#2
0
        public void RefundCalculator_ZeroBalance_ReturnsZero()
        {
            var actual = _refunder.CalculateRefund(50, 50);

            AssertRefund(actual, nickels: 0, dimes: 0, quarters: 0);
        }