コード例 #1
0
        public void ShouldInvokedNextAction()
        {
            //Arrange
            FakeDifficultySelectionAction nextAction = new FakeDifficultySelectionAction.Builder().Act(null).Build();
            DifficultySelectionAction     subject    = new DifficultySelectionAction(nextAction);

            //Act
            subject.Response("");

            //Assert
            nextAction.AssertActInvoked();
        }
コード例 #2
0
        public void ShouldReturnCorrectModeGivenInput()
        {
            //Arrange
            FakeDifficultySelectionAction   nextAction = new FakeDifficultySelectionAction.Builder().Build();
            MediumDifficultySelectionAction subject    = new MediumDifficultySelectionAction(nextAction);

            //Act
            ISelectMoveAction selectMoveAction = subject.Act("2");

            //Assert
            selectMoveAction.Should().BeOfType <MediumComputerSelectMoveAction>();
        }
コード例 #3
0
        public void ShouldInvokeNextActionIfNotHandled()
        {
            //Arrange
            FakeSelectMoveAction            fakeSelectMoveAction = new FakeSelectMoveAction.Builder().Build();
            FakeDifficultySelectionAction   nextAction           = new FakeDifficultySelectionAction.Builder().Act(fakeSelectMoveAction).Build();
            MediumDifficultySelectionAction subject = new MediumDifficultySelectionAction(nextAction);

            //Act
            subject.Act("3");

            //Assert
            nextAction.AssertActInvoked();
        }