public void ShouldUpdatePieceList() { var board = new Game.Board(); board.ParseFen(InitialBoardSetupWhiteToMoveNoWhiteRook); var rook = new Rook { Square = 21, Color = Color.White }; board.AddPiece(rook); //board.WhiteRookPieceList.Count.Should().Be(4); }
public void ShouldUpdateSquare() { var board = new Game.Board(); board.ParseFen(InitialBoardSetupWhiteToMoveNoWhiteRook); var rook = new Rook { Square = 21, Color = Color.White }; board.AddPiece(rook); board.Squares[21].Type.Should().Be(rook.Type); }
public void ShouldUpdateMaterial() { var board = new Game.Board(); board.ParseFen(InitialBoardSetupWhiteToMoveNoWhiteRook); int material = board.Material[(int)Color.White]; var rook = new Rook { Square = 21, Color = Color.White }; board.AddPiece(rook); board.Material[(int)Color.White].Should().Be(material + rook.Value); }
public void ShouldHashPieceIn() { var board = new Game.Board(); board.ParseFen(InitialBoardSetupWhiteToMoveNoWhiteRook); int initialPositionKey = board.PositionKey; board.AddPiece(new Rook { Square = 21, Color = Color.White }); board.HashPiece(board.Squares[21]); var positionKey = board.PositionKey; positionKey.Should().Be(initialPositionKey); }