-
Notifications
You must be signed in to change notification settings - Fork 14
Integration testing #6
Copy link
Copy link
Open
Description
Hi @myquay
How do I mock a service in a tenant container?
For example, suppose:
.AddMultiTenancy...
.WithTenantedServices((services, tenant) => {
services.AddSingleton<SomeService>();
});Then in my integration tests when I usually want to mock a service, for example:
hostBuilder.ConfigureServices(s => s.AddSingleton<ISomeService>(_ => someServiceMock.Object));But since it's in its own container which is resolved internally, this does not return someServiceMock but instead the real service.
I was thinking of mocking the MultiTenantServiceProviderFactory but it's internal...
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels