public void PrintGameBoard() { GameBoardManager gameBoardManager = new GameBoardManager(); gameBoardManager.GenerateNewGameBoard(); StringBuilder gameBoardAsString = new StringBuilder(); StringBuilder printed = new StringBuilder(); StringBuilder current = new StringBuilder(); gameBoardAsString.AppendLine(); for (int col = 0; col < 8; col++) { for (int row = 0; row < 25; row++) { gameBoardAsString.Append(gameBoardManager.GameBoard[row, col]); } gameBoardAsString.AppendLine(); } Console.SetOut(new System.IO.StringWriter(printed)); gameBoardManager.PrintGameBoard(); Console.SetOut(new System.IO.StringWriter(current)); Console.WriteLine(gameBoardAsString); Assert.AreEqual(current.ToString(), printed.ToString()); }
/// <summary> /// Main method make initialization of main classes, call engine to start the game and print welcome message. /// </summary> internal static void Main() { PrintWelcomeMessage(); GameBoardManager gameBoardManager = new GameBoardManager(); gameBoardManager.GenerateNewGameBoard(); gameBoardManager.PrintGameBoard(); Engine egine = new Engine(); egine.Run(gameBoardManager); }