コード例 #1
0
        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;
        }
コード例 #2
0
        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);
        }