Example #1
0
        public void TestStartGame()
        {
            using (StringWriter strWriter = new StringWriter())
            {
                Console.SetOut(strWriter);
                GameMessages.StartGame();

                string expected = string.Format(
                    "Welcome to the game “Minesweeper”. Try to reveal all cells without mines.{0}" +
                    "To reveal cells enter row and column of the cell with space for separator -     \"0 0\"{0}" +
                    "Use 'flag' command to flag/unflag cells - \"flag 0 0\"{0}" +
                    "Use 'top' to view the scoreboard, 'restart' to start a new game and 'exit' to quit the game.{0}{0}",
                    Environment.NewLine);

                Assert.AreEqual(expected, strWriter.ToString());
            }
        }