コード例 #1
0
        public void Test_Start()
        {
            // Arrange
            var view = new MockMainForm();

            // Act
            var presenter = new QuestionPresenter(view);
            view.FireStartClicked();

            // Assert
            Assert.IsTrue(view.QuestionLabelVisible);
            Assert.IsTrue(view.NextVisible);
            Assert.IsTrue(view.QuestionTextVisible);
            Assert.IsTrue(view.ChoicesLabelVisible);
            Assert.IsFalse(view.StartVisible);
            Assert.AreEqual(0, view.RemoveChoiceButtonsCallCount);
            Assert.IsTrue(view.AddChoiceButtonsCallCount > 0);
            Assert.AreEqual(0, view.ShowMessageBoxCallCount);
        }
コード例 #2
0
        public void Test_NextQuestion()
        {
            // Arrange
            var view = new MockMainForm();

            // Act
            var presenter = new QuestionPresenter(view);
            view.FireStartClicked();
            view.FireRadioButtonChecked();
            view.FireNextQuestionClicked();

            // Assert
            Assert.IsTrue(view.NextVisible);
            Assert.IsTrue(view.QuestionLabelVisible);
            Assert.IsTrue(view.QuestionTextVisible);
            Assert.IsTrue(view.ChoicesLabelVisible);
            Assert.IsFalse(view.StartVisible);
            Assert.IsTrue(view.RemoveChoiceButtonsCallCount > 0);
            Assert.IsTrue(view.AddChoiceButtonsCallCount > 0);
        }