示例#1
0
        public void ShouldReturnHumanFirstOrderGivenMatchingInput()
        {
            //Arrange
            FakePlayerTurnsOrderAction fakePlayerTurnsOrderAction = new FakePlayerTurnsOrderAction.Builder().Build();
            HumanFirstPlayerTurn       subject = new HumanFirstPlayerTurn(fakePlayerTurnsOrderAction);

            //Act
            IPlayerOrder actual = subject.Response("1");

            //Assert
            actual.Should().BeOfType <HumanFirstOrder>();
        }
示例#2
0
        public void ShouldReturnTieStatus()
        {
            //Arrange
            FakePlayerTurnsOrderAction fakePlayerTurnsOrderAction = new FakePlayerTurnsOrderAction.Builder().Response(null).Build();
            PlayerTurnsOrderAction     subject = new PlayerTurnsOrderAction(fakePlayerTurnsOrderAction);

            //Act
            subject.Response("");

            //Assert
            fakePlayerTurnsOrderAction.AssertResponseInvoked();
        }
示例#3
0
        public void ShouldReturnInvokeNextGivenNotHandled()
        {
            //Arrange
            FakePlayerOrder            fakePlayerOrder            = new FakePlayerOrder.Builder().Build();
            FakePlayerTurnsOrderAction fakePlayerTurnsOrderAction = new FakePlayerTurnsOrderAction.Builder().Response(fakePlayerOrder).Build();
            HumanFirstPlayerTurn       subject = new HumanFirstPlayerTurn(fakePlayerTurnsOrderAction);

            //Act
            IPlayerOrder actual = subject.Response("2");

            //Assert
            actual.Should().Be(fakePlayerOrder);
        }