I am trying to create a Mock (using Moq) for an IServiceProvider so that I can test my repository class:
IServiceProvider
public class ApiResourceRepository : IApiRe
The general rule is that you don't mock types that you don't own. Unless you need to verify the calls made to the service provider, just build the IServiceProvider from a ServiceCollection in your tests.
ServiceCollection