private static GameDecision DiagonalWin(Board board, string markChar)
 {
     if (board.RetrieveMarkForPosition(1) == markChar && board.RetrieveMarkForPosition(5) == markChar && board.RetrieveMarkForPosition(9) == markChar ||
         board.RetrieveMarkForPosition(3) == markChar && board.RetrieveMarkForPosition(5) == markChar && board.RetrieveMarkForPosition(7) == markChar
         )
     {
         return GameDecision.Win;
     }
     return GameDecision.PlayOn;
 }
        private static GameDecision TieCase(Board board, string markChar)
        {
            for (int i = 1; i < board.grid.Length; i++)
            {
                if (board.grid[i] == i.ToString())
                {
                    return GameDecision.PlayOn;
                }
            }

            return GameDecision.Tie;
        }
        public void PlayGame()
        {
            _board = new Board();
            _board.SetupGrid();

            GetUserNames();
            ChooseFirstPlayer();
            PlayerTurnKeeper();
            DrawBoard();
            GetUserInput();
            EndofGame();
        }
        public static GameDecision EvaluateBoard(Board board, string markChar)
        {
            //Win
            if (HorizontalWin(board, markChar) == GameDecision.Win || VerticalWin(board, markChar) == GameDecision.Win ||
                DiagonalWin(board, markChar) == GameDecision.Win)
            {
                return GameDecision.Win;
            }
            if (TieCase(board, markChar) == GameDecision.Tie)
            {
                return GameDecision.Tie;
            }

            return GameDecision.PlayOn;
        }
 public void AssertMarkPlacementInvalid()
 {
     Board board = new Board();
     var status = board.PlaceMark(10, "X");
     Assert.AreEqual(status, BoardPlacementResult.Invalid);
 }
 public void AssertMarkPlacement( )
 {
     Board board = new Board();
     var status = board.PlaceMark(3, "X");
     Assert.AreEqual(status, BoardPlacementResult.OK);
 }