-
Hi, Is it possible to replace TestServiceProvider with our own service provider - Autofac and use it, so I can skip the manual registration in tests? Thank you for your help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @otabota No, it is not currently possible to replace the internal It should not be too hard to do though, since all the types that needs services just expect a Hope this helps. |
Beta Was this translation helpful? Give feedback.
Hi @otabota
No, it is not currently possible to replace the internal
TestServiceProvider
. If you have a suggestion for how to make that possible am all ears and do welcome PRs.It should not be too hard to do though, since all the types that needs services just expect a
IServiceCollection
. My reason for creating theTestServiceProvider
type was to be able to have single property exposed namedServices
, that users could use to both register services before renderinger components, and also use to get services in their tests, if needed.Hope this helps.