SteveSandersonMS / BlazorUnitTestingPrototype

94 stars 54 forks source link

Exposed the ServiceCollection in TestHost. #3

Closed anton-micrypto closed 5 years ago

anton-micrypto commented 5 years ago

Some tests may require access to the host's services.

SteveSandersonMS commented 5 years ago

It doesn't work to expose the IServiceCollection, because that's the builder API. This exposes methods for configuring DI (e.g., AddSingleton) which wouldn't work, so it would confuse people.

Instead you'd need to expose the IServiceProvider that is created from the service collection.

anton-micrypto commented 5 years ago

Ok thanks, that makes sense.