public InsertCoinButtonPanelController(IInsertCoinButtonPanel insertCoinButtonPanel, ICoinAccepter coinAccepter) { InsertCoinButtonPanel = insertCoinButtonPanel; CoinAccepter = coinAccepter; InsertCoinButtonPanel.InsertPennyButton.Click += InsertPennyButtonEventListener; InsertCoinButtonPanel.InsertNickelButton.Click += InsertNickelButtonEventListener; InsertCoinButtonPanel.InsertDimeButton.Click += InsertDimeButtonEventListener; InsertCoinButtonPanel.InsertQuarterButton.Click += InsertQuarterButtonEventListener; }
public void TestCorrectlyBuildsCoinAccepter() { MainFormController mainFormController = new MainFormController(new Form()); ICoinAccepter coinAccepter = mainFormController.CoinAccepter; Assert.IsInstanceOf(typeof(ICoinAccepter), coinAccepter); Assert.AreSame(mainFormController.CoinFactory, coinAccepter.CoinFactory); Assert.AreSame(mainFormController.CoinPurse, coinAccepter.CoinPurse); Assert.AreSame(mainFormController.CoinReturn, coinAccepter.CoinReturn); }