Modifying StructureMap After it is intialized to inject Mocked Objects

Leave a comment

December 11, 2009 by temebele

Most of the time you initialize all your dependencies through a dependency registry.

But for your unit tests you might want to change the provided implementation with Mocked objects.

Structure map Configure method comes handy on this case. It allows you to add configuration to an existing container.

In contrast to Initialize(), the Configure() method allows you to add additional configuration to an existing Container or ObjectFactory.  “


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: