Exemple #1
0
 private static void StartApplication()
 {
     Application.EnableVisualStyles();
     game       = new TicTacToe();
     gameStates = new GameStates();
     ai         = new ComputerActions(game, gameStates);
     Application.Run(game);
 }
Exemple #2
0
        public void whenThereIsOneUnoccupiedTileThenThatTileIsReturned()
        {
            var board = new List <string> {
                "X", "X", "Y",
                "X", "X", "Y",
                "Y", "Y", "9"
            };
            var computerAction = new ComputerActions();

            Assert.Equal("9", computerAction.getBestMove(board, ""));
        }
Exemple #3
0
        public void whenThereAreNoUnoccupiedTilesThenEmptyStringIsReturned()
        {
            var board = new List <string> {
                "X", "X", "O",
                "O", "O", "X",
                "X", "X", "O"
            };
            var computerAction = new ComputerActions();

            Assert.Equal("", computerAction.getBestMove(board, ""));
        }
Exemple #4
0
        public void whenThereAreMultipleUnoccupiedTilesThenTheWinningTileIsReturned(string tile1, string tile2, string tile3,
                                                                                    string tile4, string tile5, string tile6,
                                                                                    string tile7, string tile8, string tile9,
                                                                                    string expectedMove, string playerSymbol, string assertionMessage)
        {
            var board = new List <string> {
                tile1, tile2, tile3, tile4, tile5, tile6, tile7, tile8, tile9
            };
            var computerAction = new ComputerActions();

            Assert.True(expectedMove == computerAction.getBestMove(board, playerSymbol), assertionMessage);
        }
Exemple #5
0
        public void whenANullBoardIsProvidedThenEmptyStringIsReturned()
        {
            var computerAction = new ComputerActions();

            Assert.Equal("", computerAction.getBestMove(null, ""));
        }