public ChessValidationStepsMocker SetupEnpassantFriendlyPawnValid(bool valid, Colours friend) { ChessPieceEntity pawn = new PawnEntity(friend); _castleValidationStepsMock.Setup(m => m.IsFriendlyPawnValidForEnpassant( It.IsAny <BoardMove>(), It.IsAny <IReadOnlyBoardState <ChessPieceEntity> >(), out pawn)) .Returns(valid); return(this); }
public void Execute_moves_friendly_pawn_and_removes_enemy_pawn() { var piece = new PawnEntity(Colours.White); var takenPiece = new PawnEntity(Colours.Black); var takenPieceLocation = EnPassantMove.To.MoveBack(Colours.White); SetupLocationReturn(EnPassantMove.From, piece); SetupLocationReturn(takenPieceLocation, takenPiece); SetupMockActionForMoveType((int)DefaultActions.MoveOnly); Action.Execute(EnPassantMove); VerifyLocationWasCleared(takenPieceLocation); VerifyActionWasExecuted(EnPassantMove); }