示例#1
0
        public void BottomHorizontalWinning()
        {
            var game = new TicTakToeGame();

            game.PlayX(RowColumn.BottomLeft);
            game.PlayY(RowColumn.CenterLeft);
            game.PlayX(RowColumn.BottomMiddle);
            game.PlayY(RowColumn.CenterRight);
            game.PlayX(RowColumn.BottomRight);

            var gameStatus = game.GetStatus();

            gameStatus.Should().Be(GameStatus.XWins);
        }
示例#2
0
        public void ConsiderHorizontalWinningX()
        {
            var game = new TicTakToeGame();

            game.PlayX(RowColumn.TopLeft);
            game.PlayY(RowColumn.BottomLeft);
            game.PlayX(RowColumn.TopMiddle);
            game.PlayY(RowColumn.BottomRight);
            game.PlayX(RowColumn.TopRight);

            var gameStatus = game.GetStatus();

            gameStatus.Should().Be(GameStatus.XWins);
        }
示例#3
0
        public void ConsiderAnotherDiagonalWinningX()
        {
            var game = new TicTakToeGame();

            game.PlayX(RowColumn.TopRight);
            game.PlayY(RowColumn.CenterLeft);
            game.PlayX(RowColumn.CenterMiddle);
            game.PlayY(RowColumn.BottomMiddle);
            game.PlayX(RowColumn.BottomLeft);

            var gameStatus = game.GetStatus();

            gameStatus.Should().Be(GameStatus.XWins);
        }
示例#4
0
        public void ConsiderVerticalWinningY()
        {
            var game = new TicTakToeGame();

            game.PlayX(RowColumn.BottomRight);
            game.PlayY(RowColumn.TopLeft);
            game.PlayX(RowColumn.CenterMiddle);
            game.PlayY(RowColumn.CenterLeft);
            game.PlayX(RowColumn.CenterRight);
            game.PlayY(RowColumn.BottomLeft);

            var gameStatus = game.GetStatus();

            gameStatus.Should().Be(GameStatus.YWins);
        }
示例#5
0
        public void BecomeADrawWhenAllPositionsFilled()
        {
            var game = new TicTakToeGame();

            game.PlayX(RowColumn.TopLeft);
            game.PlayY(RowColumn.TopMiddle);
            game.PlayX(RowColumn.TopRight);
            game.PlayY(RowColumn.CenterMiddle);
            game.PlayX(RowColumn.BottomMiddle);
            game.PlayY(RowColumn.CenterLeft);
            game.PlayX(RowColumn.BottomLeft);
            game.PlayY(RowColumn.BottomRight);
            game.PlayX(RowColumn.CenterRight);

            var gameStatus = game.GetStatus();

            gameStatus.Should().Be(GameStatus.Draw);
        }
示例#6
0
        public void NotBeTheSameAsOtherGame_GivenOtherGameHasBeenPlayedOneMoreTime()
        {
            var game      = new TicTakToeGame();
            var otherGame = new TicTakToeGame();

            game.PlayX(RowColumn.TopLeft);
            otherGame.PlayX(RowColumn.TopLeft);
            otherGame.PlayY(RowColumn.TopRight);

            game.Should().NotBe(otherGame);
        }