Exemplo n.º 1
0
        public void TestGameFieldPrint()
        {
            GameField gameField = new GameField();
            SetGameFieldBody(gameField, new int[,]
            {
                { 1, 2, 3, 4 },
                { 5, 6, 7, 8 },
                { 9, 10, 15, 11 },
                { 13, 14, 12, 16 }
            });

            string expected = " -------------\r\n|  1  2  3  4 |\r\n|  5  6  7  8 |\r\n|  9 10 15 11 |\r\n| 13 14 12    |\r\n -------------\r\n";

            StringBuilder sb = new StringBuilder();
            Console.SetOut(new System.IO.StringWriter(sb));
            gameField.Print();
            StringAssert.Equals(expected, sb.ToString());
        }