public void NoMoneyState_WhenRefund_NoMoneyRefunded()
        {
            var state = new NoMoneyState(_context, new List <Coin>(), new List <Coin>(), _productInfoRepository, new List <string>(), new List <Coin>());

            state.Refund(0, 0);

            CollectionAssert.AreEqual(new List <Coin>(), state.ReturnTray.ToList());
        }
Esempio n. 2
0
        public VendingMachine(ProductInfoRepository productInfoRepository)
        {
            // Machine is preloaded, should probably inject the vault
            var vault = new List <Coin>();

            vault.AddRange(Enumerable.Repeat(Coin.Quarter, 10));
            vault.AddRange(Enumerable.Repeat(Coin.Dime, 10));
            vault.AddRange(Enumerable.Repeat(Coin.Nickel, 10));

            State = new NoMoneyState(this, new List <Coin>(), new List <Coin>(), productInfoRepository, new List <string>(), vault);
        }