public void AddingBishop()
        {
            string actualColor = "black";
            int    actualX     = 4;
            int    actualY     = 4;
            Board  newBoard    = new Board();
            Bishop p1          = new Bishop(actualColor, actualX, actualY);

            Assert.AreEqual(p1.Color, actualColor);
            Assert.AreEqual(p1.X, actualX);
            Assert.AreEqual(p1.Y, actualY);
        }
Пример #2
0
        public void InCheckWhiteIllegalMoveBot()
        {
            var bot = new ChessBot(new OnlyPieceCountMatterEvaluator(), 3, Color.White, true);

            var c     = new ChessBoard();
            var board = new Piece[8, 8];

            board[0, 2] = new King(Color.Black)
            {
                AmountOfMoves = 2
            };
            board[0, 4] = new Rook(Color.Black)
            {
                AmountOfMoves = 1
            };
            board[1, 6] = new Knight(Color.Black);
            board[2, 6] = new Pawn(Color.Black);
            board[2, 7] = new Pawn(Color.Black);
            board[3, 0] = new Pawn(Color.Black);
            board[5, 1] = new Bishop(Color.Black);

            board[2, 2] = new Bishop(Color.White);
            board[3, 1] = new Knight(Color.White);
            board[4, 0] = new Pawn(Color.White);
            board[4, 1] = new Pawn(Color.White);
            board[4, 3] = new Pawn(Color.White);
            board[5, 4] = new King(Color.White);
            board[5, 6] = new Pawn(Color.White);
            board[6, 3] = new Bishop(Color.White);

            c.Board = board;

            var allMoves = c.GetAllAvailableMoves(Color.White);

            bot.FindMove(c);

            Assert.AreEqual(6, allMoves.Count());
        }