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.

http://codebetter.com/blogs/jeremy.miller/archive/2008/10/25/initializing-and-configuring-a-structuremap-container.aspx

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

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: