Example #1
0
        public void RefundCalculator_When5OfEachDenominationInVault_CanMakeChange()
        {
            var calculator = new RefundCalculator();
            var vault      = Enumerable.Repeat(Coin.Nickel, 5)
                             .Concat(Enumerable.Repeat(Coin.Dime, 5))
                             .Concat(Enumerable.Repeat(Coin.Quarter, 5));

            Assert.IsTrue(calculator.CanMakeChange(vault));
        }
Example #2
0
        public void RefundCalculator_WhenNoCoinsInVault_ExactChangeOnly()
        {
            var calculator = new RefundCalculator();

            Assert.IsFalse(calculator.CanMakeChange(Enumerable.Empty <Coin>()));
        }
Example #3
0
        public void RefundCalculator_WhenLessThan5QuartersInVault_ExactChangeOnly()
        {
            var calculator = new RefundCalculator();

            Assert.IsFalse(calculator.CanMakeChange(Enumerable.Repeat(Coin.Quarter, 4)));
        }
Example #4
0
        public override string Display()
        {
            var refundCalculator = new RefundCalculator();

            return(refundCalculator.CanMakeChange(Vault) ? "INSERT COIN" : "EXACT CHANGE ONLY");
        }