Cannot access method 'Handle' MediatR due to its protection level .net using xunit

Declare the handler variable as of type IRequestHandler<AddUserDeviceCommand>.

AsyncRequestHandler<TRequest> implements IRequestHandler<TRequest>, via which you can access its Handle method.

AddUserDeviceCommand command = new AddUserDeviceCommand(  
    ​data.AppBuildNo, data.Width, data.Height, data.PlatformInfo, data.DevicePlatform
    );
IRequestHandler<AddUserDeviceCommand> handler = new AddUserDeviceCommandHandler(
    userservice.Object, repoacc.Object
    );

await handler.Handle(command, CancellationToken.None);