Esempio n. 1
0
            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);
            }
Esempio n. 2
0
            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);
            }
Esempio n. 3
0
            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);
            }