Exemple #1
0
        public void BuildGameBoardShouldBuild4x4BoardString()
        {
            var testConsole = new FakeConsole();
            var subject     = new CLI(testConsole);

            var result = subject.BuildGameBoard(4);

            var expected =
                "             |     |     |     \n" +
                "          {0}  |  {1}  |  {2}  |  {3}  \n" +
                "             |     |     |     \n" +
                "        -----------------------\n" +
                "             |     |     |     \n" +
                "          {4}  |  {5}  |  {6}  |  {7}  \n" +
                "             |     |     |     \n" +
                "        -----------------------\n" +
                "             |     |     |     \n" +
                "          {8}  |  {9}  |  {10}  |  {11}  \n" +
                "             |     |     |     \n" +
                "        -----------------------\n" +
                "             |     |     |     \n" +
                "          {12}  |  {13}  |  {14}  |  {15}  \n" +
                "             |     |     |     \n\n";

            Assert.That(result, Is.EqualTo(expected));
        }
Exemple #2
0
        public void BuildGameBoardShouldBuild3x3BoardString()
        {
            var testConsole = new FakeConsole();
            var subject     = new CLI(testConsole);

            var result = subject.BuildGameBoard(3);

            var expected =
                "             |     |     \n" +
                "          {0}  |  {1}  |  {2}  \n" +
                "             |     |     \n" +
                "        -----------------\n" +
                "             |     |     \n" +
                "          {3}  |  {4}  |  {5}  \n" +
                "             |     |     \n" +
                "        -----------------\n" +
                "             |     |     \n" +
                "          {6}  |  {7}  |  {8}  \n" +
                "             |     |     \n\n";

            Assert.That(result, Is.EqualTo(expected));
        }