Exemple #1
0
        public void TestProperties()
        {
            MockInsertCoinButtonPanel expectedInsertCoinButtonPanel = new MockInsertCoinButtonPanel();
            MockCoinAccepter          expectedCoinAccepter          = new MockCoinAccepter();

            InsertCoinButtonPanelController insertCoinButtonPanelController =
                new InsertCoinButtonPanelController(expectedInsertCoinButtonPanel, expectedCoinAccepter);

            Assert.AreSame(expectedInsertCoinButtonPanel, insertCoinButtonPanelController.InsertCoinButtonPanel);
            Assert.AreSame(expectedCoinAccepter, insertCoinButtonPanelController.CoinAccepter);
        }
        public void TestProperties()
        {
            MockInsertCoinButtonPanel expectedInsertCoinButtonPanel = new MockInsertCoinButtonPanel();
            MockCoinAccepter expectedCoinAccepter = new MockCoinAccepter();

            InsertCoinButtonPanelController insertCoinButtonPanelController =
                new InsertCoinButtonPanelController(expectedInsertCoinButtonPanel, expectedCoinAccepter);

            Assert.AreSame(expectedInsertCoinButtonPanel, insertCoinButtonPanelController.InsertCoinButtonPanel);
            Assert.AreSame(expectedCoinAccepter, insertCoinButtonPanelController.CoinAccepter);
        }
Exemple #3
0
        public void TestClickingTheInsertPennyButtonPassesASmallCoinToTheCoinAccepter()
        {
            MockInsertCoinButtonPanel mockInsertCoinButtonPanel = new MockInsertCoinButtonPanel();
            MockCoinAccepter          mockCoinAccepter          = new MockCoinAccepter();

            new InsertCoinButtonPanelController(mockInsertCoinButtonPanel, mockCoinAccepter);

            TestClickingButtonPassesCorrectCoinSizeToCoinAccepter(CoinSize.Tiny,
                                                                  mockInsertCoinButtonPanel.InsertDimeButton, mockCoinAccepter);

            TestClickingButtonPassesCorrectCoinSizeToCoinAccepter(CoinSize.Small,
                                                                  mockInsertCoinButtonPanel.InsertPennyButton, mockCoinAccepter);

            TestClickingButtonPassesCorrectCoinSizeToCoinAccepter(CoinSize.Medium,
                                                                  mockInsertCoinButtonPanel.InsertNickelButton, mockCoinAccepter);

            TestClickingButtonPassesCorrectCoinSizeToCoinAccepter(CoinSize.Large,
                                                                  mockInsertCoinButtonPanel.InsertQuarterButton, mockCoinAccepter);
        }
        public void TestClickingTheInsertPennyButtonPassesASmallCoinToTheCoinAccepter()
        {
            MockInsertCoinButtonPanel mockInsertCoinButtonPanel = new MockInsertCoinButtonPanel();
            MockCoinAccepter mockCoinAccepter = new MockCoinAccepter();

            new InsertCoinButtonPanelController(mockInsertCoinButtonPanel, mockCoinAccepter);

            TestClickingButtonPassesCorrectCoinSizeToCoinAccepter(CoinSize.Tiny,
                mockInsertCoinButtonPanel.InsertDimeButton, mockCoinAccepter);

            TestClickingButtonPassesCorrectCoinSizeToCoinAccepter(CoinSize.Small,
                mockInsertCoinButtonPanel.InsertPennyButton, mockCoinAccepter);

            TestClickingButtonPassesCorrectCoinSizeToCoinAccepter(CoinSize.Medium,
                mockInsertCoinButtonPanel.InsertNickelButton, mockCoinAccepter);

            TestClickingButtonPassesCorrectCoinSizeToCoinAccepter(CoinSize.Large,
                mockInsertCoinButtonPanel.InsertQuarterButton, mockCoinAccepter);

        }