public void PlayersMustMoveWithinTheTopLeftBoundsOfTheBoard()
        {
            var naughts = new TurnByTurnPlayerStub();
            var game = new TicTacToeGame(naughts, null);

            naughts.Next(0, 0);

            Assert.Throws<InvalidMoveException>(() => game.PlayTurn());
        }
        public void NaughtsStartsTheGame()
        {
            var naughts = new TurnByTurnPlayerStub();
            var game = new TicTacToeGame(naughts, null);

            naughts.Next(1, 1);
            game.PlayTurn();

            Assert.That(game.PlayerOnSquare(1, 1), Is.EqualTo(naughts));
        }
        public void PlayersAlternateTurns()
        {
            var naughts = new TurnByTurnPlayerStub();
            var crosses = new TurnByTurnPlayerStub();
            var game = new TicTacToeGame(naughts, crosses);

            naughts.Next(1, 1);
            game.PlayTurn();

            Assert.That(game.CurrentPlayer, Is.EqualTo(crosses));
        }
        public void PlayersTurnIsNotOverUntilTheyMakeAValidMove()
        {
            var naughts = new TurnByTurnPlayerStub();
            var crosses = new TurnByTurnPlayerStub();
            var game = new TicTacToeGame(naughts, crosses);

            naughts.Next(1, 1);
            game.PlayTurn();

            crosses.Next(1, 1);
            game.PlayTurn();

            Assert.That(game.CurrentPlayer, Is.EqualTo(crosses));
        }
        public void OnlyOnePlayerCanClaimEachSquare()
        {
            var naughts = new TurnByTurnPlayerStub();
            var crosses = new TurnByTurnPlayerStub();
            var game = new TicTacToeGame(naughts, crosses);

            naughts.Next(1, 1);
            game.PlayTurn();

            crosses.Next(1, 1);
            game.PlayTurn();

            Assert.That(game.PlayerOnSquare(1, 1), Is.EqualTo(naughts));
        }