Beispiel #1
0
        public void GeneratesCorrectBishopMovesBlack()
        {
            // Assemble
            var board = new Board
            {
                WhitePawns   = 0x00_00_00_00_00_29_d6_00,
                WhiteBishops = 0x00_00_00_00_02_40_00_00,
                BlackPawns   = 0x00_d5_22_10_00_00_00_00,
                BlackBishops = 0x00_00_00_00_09_00_00_00
            };

            var position = new Position(board, Side.Black, null, CastlingRights.None, 0);
            var moves    = new List <Move>();

            // Act
            MoveGenerator.AddBishopMoves(position, moves);

            // Assert
            moves.Should().HaveCount(12);
            moves.Where(m => m.From == Square.a4).Should().HaveCount(6);
            moves.Where(m => m.From == Square.d4).Should().HaveCount(6);
            moves.Where(m => m.IsCapture).Should().HaveCount(2);
        }
 public void GetBishopMoves() => MoveGenerator.AddBishopMoves(_position, new List <Move>());