In the project I’m working on I have a StructureMap registry for the main web project and another registry for my integration tests. During some of the tests I wire up the web project’s registry, so that I can get objects out of the container for testing.
In one case I want to be able to replace a default concrete type from the web registry with one in the test registry.
Is this possible?
How do you do it?
Yes you can, the container will serve up which ever type is last defined (according to my tests). I theorize (but I am unsure) that my mistake was that I called the
IInitializationExpression.Scanmechanism after I registered some type and it got reregistered back to it’s original setting.