Example #1
0
        public void ExpectBuildEstablismentToBeExecutable()
        {
            var player = new Mock<IPlayer>();
            var turn = new BuildTurn(player.Object);

            Assert.True(turn.CanExecute(GameCommand.BuildEstablisment));
            Assert.False(turn.CanExecute(GameCommand.BuildRoad));
        }
Example #2
0
        public void ExpectBuildTurnToEndAfterRoadAndEstablismentBuildExecuted()
        {
            var player = new Mock<IPlayer>();
            var turn = new BuildTurn(player.Object);

            bool ended = false;
            turn.Ended += (sender, args) => { ended = true; };

            turn.AfterExecute(GameCommand.BuildEstablisment);
            turn.AfterExecute(GameCommand.BuildRoad);

            Assert.True(ended);
            Assert.False(turn.CanExecute(GameCommand.BuildEstablisment));
            Assert.False(turn.CanExecute(GameCommand.BuildRoad));
        }
Example #3
0
 public void BuildTurnConstructionSucceeds()
 {
     var player = new Mock<IPlayer>();
     var turn = new BuildTurn(player.Object);
     Assert.Equal(player.Object, turn.Player);
 }