/// <summary> /// Initialization constructor /// </summary> /// <param name="coinAcceptor">Coin acceptor interface to use</param> /// <param name="coinAppraiser">Coin appraiser interface to use</param> /// <param name="coinReturn">Coin return, with coins and their quanities</param> /// todo: IoC needed here down the road public VendingMachine( ICoinAcceptor coinAcceptor, ICoinAppraiser coinAppraiser, IDictionary<InsertedCoin, int> coinReturn, IDisplay display, IProductSelector productSelector, IChangeProvider changeProvider, IDictionary<InsertedCoin, int> internalSafe) { this.CoinAcceptor = coinAcceptor; this.CoinAppraiser = coinAppraiser; this.CoinReturn = coinReturn; this.Display = display; this.Display.Message = VendingMachine.InsertCoinsMessage; this.ProductSelectorButtons = productSelector; this.ProductSelectorButtons.OnSelectedProductChanged += this.OnProductSelected; this.ChangeProvider = changeProvider; this.InternalSafe = internalSafe; }
public void SetUp() { _changeProvider = Substitute.For <IChangeProvider>(); _vendingMachine = new VendingMachine(_changeProvider); }
public VendingMachine(IChangeProvider changeProvider) { _changeProvider = changeProvider; }
public void arrangeForTests() { //Arrange this._changeProvider = new ChangeProvider(); this._coinAppraiser = new CoinAppraiser(); //todo: evaluate use of mock }
public void SetUp() { _coinsAvability = Substitute.For <ICoinsAvability>(); _changeProvider = new ChangeProvider(_coinsAvability); }