Example #1
0
        public void RenderToString_DrawInitialBoardWithNumericHints_ExpectedStringForDrawingIsReturned()
        {
            var expectedRenderString =
                "   A B C D E F G H \n" +
                "  ┌─┬─┬─┬─┬─┬─┬─┬─┐\n" +
                " 0│ │ │ │ │ │ │ │ │\n" +
                "  ├─┼─┼─┼─┼─┼─┼─┼─┤\n" +
                " 1│ │ │ │ │ │ │ │ │\n" +
                "  ├─┼─┼─┼─┼─┼─┼─┼─┤\n" +
                " 2│ │ │ │3│ │ │ │ │\n" +
                "  ├─┼─┼─┼─┼─┼─┼─┼─┤\n" +
                " 3│ │ │3│█│░│ │ │ │\n" +
                "  ├─┼─┼─┼─┼─┼─┼─┼─┤\n" +
                " 4│ │ │ │░│█│3│ │ │\n" +
                "  ├─┼─┼─┼─┼─┼─┼─┼─┤\n" +
                " 5│ │ │ │ │3│ │ │ │\n" +
                "  ├─┼─┼─┼─┼─┼─┼─┼─┤\n" +
                " 6│ │ │ │ │ │ │ │ │\n" +
                "  ├─┼─┼─┼─┼─┼─┼─┼─┤\n" +
                " 7│ │ │ │ │ │ │ │ │\n" +
                "  └─┴─┴─┴─┴─┴─┴─┴─┘\n";

            var player    = Black;
            var gameBoard = new Board(8, 8);

            gameBoard.InitBoard();

            var hintBoard        = AiWithScoreTable.GetNumericHints(gameBoard, player);
            var actualDrawString = Graphics.RenderToString(gameBoard, hintBoard);

            Assert.AreEqual(expectedRenderString, actualDrawString);
        }
Example #2
0
        public void AiEvalBoard_GetNumericHintBoard_ProperNumericHintBoardIsReturned()
        {
            var currenPlayer = Constants.Black;
            var gameBoard    = CreateBoard();

            var expectedHintData = new[]
            {
                // A   B   C   D   E   F   G   H
                // 0   1   2   3   4   5   6   7
                ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 0
                ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 1
                ' ', ' ', ' ', '3', ' ', ' ', ' ', ' ', // 2
                ' ', ' ', '3', ' ', ' ', ' ', ' ', ' ', // 3
                ' ', ' ', ' ', ' ', ' ', '3', ' ', ' ', // 4
                ' ', ' ', ' ', ' ', '3', ' ', ' ', ' ', // 5
                ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 6
                ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 7
            };
            var expectedHintBoard = CreateBoard(expectedHintData);

            var actualHintBoard = AiWithScoreTable.GetNumericHints(gameBoard, currenPlayer);

            Assert.AreEqual(expectedHintBoard, actualHintBoard);
        }