private ReadyToAcceptCoins CreateReadyToAcceptCoinsState() { var readyToSellState = new ReadyToSellProduct( _wallet, _inventory, _pricesProvider, new VMachine(_wallet, _inventory, _pricesProvider, _changeCalculator ) ); return(new ReadyToAcceptCoins(readyToSellState)); }
public void SelectNonExistentProductFail() { var state = new ReadyToSellProduct( _wallet, _inventory, _pricesProvider, new VMachine(_wallet, _inventory, _pricesProvider, _changeCalculator ) ); Assert.Throws <ProductNotAvailableException>( () => state.SelectProduct(Product.Juice) ); Assert.True(state.VendingMachine.State is ReadyToSellProduct); }
public void SelectProductAndChangeStateSuccess() { var state = new ReadyToSellProduct( _wallet, _inventory, _pricesProvider, new VMachine(_wallet, _inventory, _pricesProvider, _changeCalculator ) ); state.SelectProduct(Product.Espresso); Assert.Equal(Product.Espresso, state.SelectedProduct ); Assert.True(state.VendingMachine.State is ReadyToAcceptCoins); }