I have a requirement to access the container directly because Prism's IContainerRegistry doesn't provide me the ability to pass parameters through the constructor of an instance I am registering.
However I can't mock IContainerRegistry because I have to call .GetContainer() on it, which is a static extension method.
In short, if I have to access the container directly to do something more complex than IContainerRegistry and IContainerProvider provide in their interfaces and have to get the container directly via .GetContainer(), what is the best way to unit test RegisterTypes(IContainerRegistry) and OnInitialized(IContainerProvider)?
- I considered passing in a concrete implementation of the IContainerRegistry but this is much less than ideal.
- I also don't think I can create a wrapper for the extension method since I can't change the signature of RegisterTypes as this is an implementation detail of the Prism library and not my own code.