public void ShouldMoveToToSquare() { var board = new Game.Board(); board.ParseFen(InitialBoardSetupWhiteToMoveNoWhiteRooksPawn); var from = new Rook { Square = 21, Color = Color.White }; var to = new Rook { Square = 31, Color = Color.White }; board.CastlePiece(from, to); board.Squares[31].Type.Should().Be(to.Type); }
public void ShouldChangeThePieceListCountsWhenCastling() { var board = new Game.Board(); board.ParseFen(InitialBoardSetupWhiteToMoveNoWhiteRooksPawn); var from = new Rook { Square = 21, Color = Color.White }; var to = new Rook { Square = 31, Color = Color.White }; board.CastlePiece(from, to); //board.WhiteRookPieceList.Count.Should().Be(4); }
public void ShouldHashPieceIn() { var board = new Game.Board(); board.ParseFen(InitialBoardSetupWhiteToMoveNoWhiteRooksPawn); int initialPositionKey = board.PositionKey; var from = new Rook { Square = 21, Color = Color.White }; var to = new Rook { Square = 31, Color = Color.White }; board.CastlePiece(from, to); board.HashPiece(from); board.HashPiece(to); var positionKey = board.PositionKey; positionKey.Should().Be(initialPositionKey); }