Ejemplo n.º 1
0
            public void ShouldRemovePieceFromList()
            {
                var board = new Game.Board();

                board.ParseFen(InitialBoardSetupWhiteToMove);

                board.ClearPiece(board.Squares[21]);

                //board.WhiteRookPieceList.Count.Should().Be(3);
            }
Ejemplo n.º 2
0
            public void ShouldEmptyTheSquare()
            {
                var board = new Game.Board();

                board.ParseFen(InitialBoardSetupWhiteToMove);

                board.ClearPiece(board.Squares[21]);

                board.Squares[21].Type.Should().Be(PieceType.Empty);
            }
Ejemplo n.º 3
0
            public void ShouldUpdateTheMaterial()
            {
                var board = new Game.Board();

                board.ParseFen(InitialBoardSetupWhiteToMove);
                int material = board.Material[(int)Color.White];

                board.ClearPiece(board.Squares[21]);

                board.Material[(int)Color.White].Should().Be(material - new Rook().Value);
            }
Ejemplo n.º 4
0
            public void ShouldHashOutPiece()
            {
                var board = new Game.Board();

                board.ParseFen(InitialBoardSetupWhiteToMove);

                int initialPositionKey = board.PositionKey;

                board.ClearPiece(board.Squares[21]);


                board.HashPiece(new Rook {
                    Square = 21
                });
                var positionKey = board.PositionKey;

                initialPositionKey.Should().Be(positionKey);
            }