Esempio n. 1
0
        public void ReturnNoWinner(List <List <Symbol> > currentBoard)
        {
            Symbol     playerSymbol = Symbol.Naught;
            GameStatus game         = new GameStatus(currentBoard, playerSymbol);
            var        actualResult = game.HasWinner();

            Assert.IsFalse(actualResult);
        }
Esempio n. 2
0
        public void ReturnAWinnerForCross(List <List <Symbol> > currentBoard)
        {
            Symbol     playerSymbol = Symbol.Cross;
            GameStatus game         = new GameStatus(currentBoard, playerSymbol);
            var        actualResult = game.HasWinner();

            Assert.IsTrue(actualResult);
        }
Esempio n. 3
0
        private void CheckGameStatus(Player currentPlayer)
        {
            GameStatus = new GameStatus(Board.CurrentGameBoard, currentPlayer.PlayerSymbol);
            _gameOver  = GameStatus.HasWinner();

            if (_gameOver)
            {
                DisplayGameResult();
            }
        }
Esempio n. 4
0
 private void DisplayGameResult()
 {
     if (!GameStatus.HasWinner())
     {
         if (GameStatus.IsADrawGame())
         {
             Console.WriteLine("It's a draw game.");
         }
     }
     else
     {
         Console.WriteLine("Move accepted, well done you've won the game!");
     }
     Console.WriteLine(Board.DisplayCurrentBoard());
     Console.ReadLine();
     Environment.Exit(0);
 }