|
From: <jer...@us...> - 2009-01-12 03:29:39
|
Revision: 220
http://structuremap.svn.sourceforge.net/structuremap/?rev=220&view=rev
Author: jeremydmiller
Date: 2009-01-12 03:29:13 +0000 (Mon, 12 Jan 2009)
Log Message:
-----------
The final check in for 2.5.2
Modified Paths:
--------------
trunk/Source/HTML/AutoMocker.htm
trunk/Source/HTML/DependencyInjection.htm
trunk/Source/HTML/HTML.csproj
trunk/Source/HTML/InversionOfControl.htm
trunk/Source/HTML/Menu.htm
trunk/Source/StructureMap/StructureMap.csproj
trunk/Source/StructureMap.AutoMocking/AutoMocker.cs
trunk/Source/StructureMap.Testing/AutoMocking/RhinoAutoMockerTester.cs
trunk/Source/StructureMap.sln
Added Paths:
-----------
trunk/Source/HTML/StructureMap.chm
trunk/Source/HTML/TableOfContents.htm
trunk/Source/HTML/ToC-Bullet-List.xml
trunk/Source/TableOfContentsBuilder/
trunk/Source/TableOfContentsBuilder/Program.cs
trunk/Source/TableOfContentsBuilder/Properties/
trunk/Source/TableOfContentsBuilder/Properties/AssemblyInfo.cs
trunk/Source/TableOfContentsBuilder/TableOfContentsBuilder.csproj
trunk/Source/TableOfContentsBuilder/XmlExtensions.cs
trunk/bin/Watin/
trunk/bin/Watin/Interop.SHDocVw.dll
trunk/bin/Watin/WatiN.Core.dll
Modified: trunk/Source/HTML/AutoMocker.htm
===================================================================
--- trunk/Source/HTML/AutoMocker.htm 2009-01-11 22:43:11 UTC (rev 219)
+++ trunk/Source/HTML/AutoMocker.htm 2009-01-12 03:29:13 UTC (rev 220)
@@ -7,6 +7,385 @@
<script type="text/javascript" src="structuremap.js"></script>
</head>
<body>
- Forthcoming... ETA: 1st Qtr 2009
+ <p>StructureMap includes an
+ <a href="http://blog.eleutian.com/CommentView,guid,762249da-e25a-4503-8f20-c6d59b1a69bc.aspx">
+ Auto Mocking Container</a> (a couple actually). If you're not familiar
+ with the concept, an Auto Mocking Container repurposes an IoC container to
+ automate the creation and attachment of mock objects to a concrete class within
+ unit tests. The key fact about any auto mocking container is that it
+ reduces the mechanical cost of creating
+ <a href="http://codebetter.com/blogs/jeremy.miller/pages/129544.aspx">
+ interaction tests</a> by obviating the need to create mock objects by hand,
+ track those mock objects in the test, and apply the mocks to a concrete class.
+ Out of the box, StructureMap includes the RhinoAutoMocker for
+ <a href="http://ayende.com/projects/rhino-mocks.aspx">RhinoMocks</a> and
+ MoqAutoMocker for <a href="http://code.google.com/p/moq/">Moq</a>. The
+ Auto Mocking support is in the StructureMap.AutoMocking.dll.</p>
+ <p> </p>
+
+ <h2>How it Works</h2>
+ <p>Let's start with an example from the unit tests. Let's say that you have a
+ class named "ConcreteClass" that uses three other types of services to perform
+ its responsibilities.</p>
+<!--
+{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;}??\fs20 \cf3 public\cf0 ConcreteClass(\cf4 IMockedService\cf0 service, \cf4 IMockedService2\cf0 service2, \cf4 IMockedService3\cf0 service3)\par ?? \{\par ?? _service = service;\par ?? _service2 = service2;\par ?? _service3 = service3;\par ?? \}}
+-->
+ <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;">
+ <p style="margin: 0px;">
+ <span style="color: blue;">
+ public</span> ConcreteClass(<span style="color: #2b91af;">IMockedService</span>
+ service, <span style="color: #2b91af;">IMockedService2</span> service2,
+ <span style="color: #2b91af;">IMockedService3</span> service3)</p>
+ <p style="margin: 0px;">
+ {</p>
+ <p style="margin: 0px;">
+
+ _service = service;</p>
+ <p style="margin: 0px;">
+
+ _service2 = service2;</p>
+ <p style="margin: 0px;">
+
+ _service3 = service3;</p>
+ <p style="margin: 0px;">
+ }</p>
+ </div>
+<!--EndFragment-->
+<p>Traditionally, I might write integration tests against ConcreteClass by creating
+ a different mock object for each service dependency, attach each in the
+ constructor function of ConcreteClass, and probably track each mock object in a
+ field of the unit test fixture. With the auto mocking container, it's
+ simpler:</p>
+<!--
+{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green128\blue0;\red0\green0\blue255;\red43\green145\blue175;}??\fs20 \cf3 // This sets up a Rhino Auto Mocker in the Arrange, Act, Assert mode\par ??\cf0 \cf4 var\cf0 autoMocker = \cf4 new\cf0 \cf5 RhinoAutoMocker\cf0 <\cf5 ConcreteClass\cf0 >(\cf5 MockMode\cf0 .AAA);}
+-->
+ <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;">
+ <p style="margin: 0px;">
+ <span style="color: green;">
+ // This sets up a Rhino Auto Mocker in the Arrange, Act, Assert mode</span></p>
+ <p style="margin: 0px;">
+ <span style="color: blue;">
+ var</span> autoMocker = <span style="color: blue;">new</span>
+ <span style="color: #2b91af;">RhinoAutoMocker</span><<span
+ style="color: #2b91af;">ConcreteClass</span>>(<span style="color: #2b91af;">MockMode</span>.AAA);</p>
+ </div>
+<!--EndFragment-->
+<p>That's the entire mock object setup. To get an instance of the
+ ConcreteClass inside the unit test you access the ClassUnderTest property of the
+ auto mocker:</p>
+<!--
+{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green128\blue0;\red43\green145\blue175;}??\fs20 \cf3 // Act in the test\par ??\cf0 \cf4 ConcreteClass\cf0 @class = autoMocker.ClassUnderTest;\par ?? @class.CallService();}
+-->
+ <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;">
+ <p style="margin: 0px;">
+ <span style="color: green;">
+ // Act in the test</span></p>
+ <p style="margin: 0px;">
+ <span style="color: #2b91af;">
+ ConcreteClass</span> @class = autoMocker.ClassUnderTest;</p>
+ <p style="margin: 0px;">
+ @class.CallService();</p>
+ </div>
+<!--EndFragment-->
+<p>At the first call to the RhinoAutoMocker.ClassUnderTest, the RhinoAutoMocker:</p>
+ <ol>
+ <li> Looked at ConcreteClass</li>
+ <li>Saw that the greediest constructor required instances of three different
+ dependencies</li>
+ <li>Created mock objects using the RhinoMocks MockRepository.CreateMock<T>() method
+ for each type of dependency</li>
+ <li>Then called the constructor function of ConcreteClass to build a new instance</li>
+ </ol>
+ <p>
+ ClassUnderTest is created upon demand. Likewise, you can access the actual
+ mock objects either to set expectations before ClassUnderTest is created, or to
+ assert method calls after the action. Use the Get<T>() method to access
+ the mock objects per type that will be used in the test:</p>
+<!--
+{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green128\blue0;\red43\green145\blue175;}??\fs20 \cf3 // This retrieves the mock object for IMockedService\par ??\cf0 autoMocker.Get<\cf4 IMockedService\cf0 >().AssertWasCalled(s => s.Go());}
+-->
+ <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;">
+ <p style="margin: 0px;">
+ <span style="color: green;">
+ // This retrieves the mock object for IMockedService</span></p>
+ <p style="margin: 0px;">
+ autoMocker.Get<<span
+ style="color: #2b91af;">IMockedService</span>>().AssertWasCalled(s =>
+ s.Go());</p>
+ </div>
+<!--EndFragment-->
+<hr />
+
+ <h2>How it uses Mock Engines</h2>
+ <p>If you wanted to use the AutoMocker with another type of Mock Object Library, you
+ can simply use the AutoMocker<CLASSUNDERTEST> class, but feed it an
+ implementation of this interface that works with the mock object library of your
+ choice:</p>
+<!--
+{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;}??\fs20 \cf3 public\cf0 \cf3 interface\cf0 \cf4 ServiceLocator\par ??\cf0 \{\par ?? T Service<T>() \cf3 where\cf0 T : \cf3 class\cf0 ;\par ?? \cf3 object\cf0 Service(\cf4 Type\cf0 serviceType);\par ?? T PartialMock<T>(\cf3 params\cf0 \cf3 object\cf0 [] args) \cf3 where\cf0 T : \cf3 class\cf0 ;\par ?? \}}
+-->
+ <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;">
+ <p style="margin: 0px;">
+ <span style="color: blue;">public</span> <span style="color: blue;">interface</span>
+ <span style="color: #2b91af;">ServiceLocator</span></p>
+ <p style="margin: 0px;">
+ {</p>
+ <p style="margin: 0px;">
+ T Service<T>() <span style="color: blue;">where</span>
+ T : <span style="color: blue;">class</span>;</p>
+ <p style="margin: 0px;">
+ <span style="color: blue;">object</span> Service(<span
+ style="color: #2b91af;">Type</span> serviceType);</p>
+ <p style="margin: 0px;">
+ T PartialMock<T>(<span style="color: blue;">params</span>
+ <span style="color: blue;">object</span>[] args) <span style="color: blue;">
+ where</span> T : <span style="color: blue;">class</span>;</p>
+ <p style="margin: 0px;">
+ }</p>
+ </div>
+<!--EndFragment-->
+<p>The RhinoMocks "AAA" mode is shown below:</p>
+<!--
+{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;}??\fs20 \cf3 public\cf0 \cf3 class\cf0 \cf4 RhinoMocksAAAServiceLocator\cf0 : \cf4 ServiceLocator\par ??\cf0 \{\par ?? \cf3 private\cf0 \cf3 readonly\cf0 \cf4 RhinoMockRepositoryProxy\cf0 _mocks = \cf3 new\cf0 \cf4 RhinoMockRepositoryProxy\cf0 ();\par ??\par ?? \cf3 public\cf0 T Service<T>() \cf3 where\cf0 T : \cf3 class\par ??\cf0 \{\par ?? \cf3 var\cf0 instance = (T)_mocks.DynamicMock(\cf3 typeof\cf0 (T));\par ?? _mocks.Replay(instance);\par ?? \cf3 return\cf0 instance;\par ?? \}\par ??\par ?? \cf3 public\cf0 \cf3 object\cf0 Service(\cf4 Type\cf0 serviceType)\par ?? \{\par ?? \cf3 var\cf0 instance = _mocks.DynamicMock(serviceType);\par ?? _mocks.Replay(instance);\par ?? \cf3 return\cf0 instance;\par ?? \}\par ??\par ?? \cf3 public\cf0 T PartialMock<T>(\cf3 params\cf0 \cf3 object\cf0 [] args) \cf3 where\cf0 T : \cf3 class\par ??\cf0 \{\par ?? \cf3 var\cf0 instance = (T)_mocks.PartialMock(\cf3 typeof\cf0 (T), args);\par ?? _mocks.Replay(instance);\par ?? \cf3 return\cf0 instance;\par ?? \}\par ?? \}}
+-->
+ <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;">
+ <p style="margin: 0px;">
+ <span style="color: blue;">public</span> <span style="color: blue;">class</span>
+ <span style="color: #2b91af;">RhinoMocksAAAServiceLocator</span> :
+ <span style="color: #2b91af;">ServiceLocator</span></p>
+ <p style="margin: 0px;">
+ {</p>
+ <p style="margin: 0px;">
+ <span style="color: blue;">private</span>
+ <span style="color: blue;">readonly</span> <span style="color: #2b91af;">
+ RhinoMockRepositoryProxy</span> _mocks = <span style="color: blue;">new</span>
+ <span style="color: #2b91af;">RhinoMockRepositoryProxy</span>();</p>
+ <p style="margin: 0px;">
+ </p>
+ <p style="margin: 0px;">
+ <span style="color: blue;">public</span> T
+ Service<T>() <span style="color: blue;">where</span> T :
+ <span style="color: blue;">class</span></p>
+ <p style="margin: 0px;">
+ {</p>
+ <p style="margin: 0px;">
+ <span style="color: blue;">
+ var</span> instance = (T)_mocks.DynamicMock(<span style="color: blue;">typeof</span>
+ (T));</p>
+ <p style="margin: 0px;">
+ _mocks.Replay(instance);</p>
+ <p style="margin: 0px;">
+ <span style="color: blue;">
+ return</span> instance;</p>
+ <p style="margin: 0px;">
+ }</p>
+ <p style="margin: 0px;">
+ </p>
+ <p style="margin: 0px;">
+ <span style="color: blue;">public</span>
+ <span style="color: blue;">object</span> Service(<span style="color: #2b91af;">Type</span>
+ serviceType)</p>
+ <p style="margin: 0px;">
+ {</p>
+ <p style="margin: 0px;">
+ <span style="color: blue;">
+ var</span> instance = _mocks.DynamicMock(serviceType);</p>
+ <p style="margin: 0px;">
+ _mocks.Replay(instance);</p>
+ <p style="margin: 0px;">
+ <span style="color: blue;">
+ return</span> instance;</p>
+ <p style="margin: 0px;">
+ }</p>
+ <p style="margin: 0px;">
+ </p>
+ <p style="margin: 0px;">
+ <span style="color: blue;">public</span> T
+ PartialMock<T>(<span style="color: blue;">params</span>
+ <span style="color: blue;">object</span>[] args) <span style="color: blue;">
+ where</span> T : <span style="color: blue;">class</span></p>
+ <p style="margin: 0px;">
+ {</p>
+ <p style="margin: 0px;">
+ <span style="color: blue;">
+ var</span> instance = (T)_mocks.PartialMock(<span style="color: blue;">typeof</span>(T),
+ args);</p>
+ <p style="margin: 0px;">
+ _mocks.Replay(instance);</p>
+ <p style="margin: 0px;">
+ <span style="color: blue;">
+ return</span> instance;</p>
+ <p style="margin: 0px;">
+ }</p>
+ <p style="margin: 0px;">
+ }</p>
+ </div>
+<!--EndFragment-->
+<p>And this is the Moq version:</p>
+<!--
+{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;}??\fs20 \cf3 public\cf0 \cf3 class\cf0 \cf4 MoqServiceLocator\cf0 : \cf4 ServiceLocator\par ??\cf0 \{\par ?? \cf3 private\cf0 \cf3 readonly\cf0 \cf4 MoqFactory\cf0 _moqs = \cf3 new\cf0 \cf4 MoqFactory\cf0 ();\par ?? \par ?? \cf3 public\cf0 T Service<T>() \cf3 where\cf0 T : \cf3 class\par ??\cf0 \{\par ?? \cf3 return\cf0 (T)_moqs.CreateMock(\cf3 typeof\cf0 (T));\par ?? \}\par ??\par ?? \cf3 public\cf0 \cf3 object\cf0 Service(\cf4 Type\cf0 serviceType)\par ?? \{\par ?? \cf3 return\cf0 _moqs.CreateMock(serviceType);\par ?? \}\par ??\par ?? \cf3 public\cf0 T PartialMock<T>(\cf3 params\cf0 \cf3 object\cf0 [] args) \cf3 where\cf0 T : \cf3 class\par ??\cf0 \{\par ?? \cf3 return\cf0 (T)_moqs.CreateMockThatCallsBase(\cf3 typeof\cf0 (T), args);\par ?? \}\par ?? \}}
+-->
+ <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;">
+ <p style="margin: 0px;">
+ <span style="color: blue;">public</span> <span style="color: blue;">class</span>
+ <span style="color: #2b91af;">MoqServiceLocator</span> :
+ <span style="color: #2b91af;">ServiceLocator</span></p>
+ <p style="margin: 0px;">
+ {</p>
+ <p style="margin: 0px;">
+ <span style="color: blue;">private</span>
+ <span style="color: blue;">readonly</span> <span style="color: #2b91af;">
+ MoqFactory</span> _moqs = <span style="color: blue;">new</span>
+ <span style="color: #2b91af;">MoqFactory</span>();</p>
+ <p style="margin: 0px;">
+ </p>
+ <p style="margin: 0px;">
+ <span style="color: blue;">public</span> T
+ Service<T>() <span style="color: blue;">where</span> T :
+ <span style="color: blue;">class</span></p>
+ <p style="margin: 0px;">
+ {</p>
+ <p style="margin: 0px;">
+ <span style="color: blue;">
+ return</span> (T)_moqs.CreateMock(<span style="color: blue;">typeof</span>(T));</p>
+ <p style="margin: 0px;">
+ }</p>
+ <p style="margin: 0px;">
+ </p>
+ <p style="margin: 0px;">
+ <span style="color: blue;">public</span>
+ <span style="color: blue;">object</span> Service(<span style="color: #2b91af;">Type</span>
+ serviceType)</p>
+ <p style="margin: 0px;">
+ {</p>
+ <p style="margin: 0px;">
+ <span style="color: blue;">
+ return</span> _moqs.CreateMock(serviceType);</p>
+ <p style="margin: 0px;">
+ }</p>
+ <p style="margin: 0px;">
+ </p>
+ <p style="margin: 0px;">
+ <span style="color: blue;">public</span> T
+ PartialMock<T>(<span style="color: blue;">params</span>
+ <span style="color: blue;">object</span>[] args) <span style="color: blue;">
+ where</span> T : <span style="color: blue;">class</span></p>
+ <p style="margin: 0px;">
+ {</p>
+ <p style="margin: 0px;">
+ <span style="color: blue;">
+ return</span> (T)_moqs.CreateMockThatCallsBase(<span style="color: blue;">typeof</span>
+ (T), args);</p>
+ <p style="margin: 0px;">
+ }</p>
+ <p style="margin: 0px;">
+ }</p>
+ </div>
+<!--EndFragment-->
+<hr />
+
+ <h2>Supplying Mocks or Stubs to the AutoMocker</h2>
+ <p>Frequently you may want to use the AutoMocker, but override the normal mock
+ object creation with your own stub or hand rolled mock objects. That's
+ easy enough with the Inject() methods:</p>
+<!--
+{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red128\green128\blue128;\red0\green128\blue0;\red0\green0\blue255;\red43\green145\blue175;}??\fs20 \cf3 ///\cf4 \cf3 <summary>\par ??\cf0 \cf3 ///\cf4 Method to specify the exact object that will be used for \par ??\cf0 \cf3 ///\cf4 "pluginType." Useful for stub objects and/or static mocks\par ??\cf0 \cf3 ///\cf4 \cf3 </summary>\par ??\cf0 \cf3 ///\cf4 \cf3 <param name="pluginType"></param>\par ??\cf0 \cf3 ///\cf4 \cf3 <param name="stub"></param>\par ??\cf0 \cf5 void\cf0 Inject(\cf6 Type\cf0 pluginType, \cf5 object\cf0 stub);\par ??\par ?? \cf3 ///\cf4 \cf3 <summary>\par ??\cf0 \cf3 ///\cf4 Method to specify the exact object that will be used for \par ??\cf0 \cf3 ///\cf4 "pluginType." Useful for stub objects and/or static mocks\par ??\cf0 \cf3 ///\cf4 \cf3 </summary>\par ??\cf0 \cf3 ///\cf4 \cf3 <typeparam name="T"></typeparam>\par ??\cf0 \cf3 ///\cf4 \cf3 <param name="target"></param>\par ??\cf0 \cf5 void\cf0 Inject<T>(T target);}
+-->
+ <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;">
+ <p style="margin: 0px;">
+ <span style="color: gray;">///</span><span
+ style="color: green;"> </span><span style="color: gray;"><summary></span></p>
+ <p style="margin: 0px;">
+ <span style="color: gray;">///</span><span
+ style="color: green;"> Method to specify the exact object that will be used
+ for </span>
+ </p>
+ <p style="margin: 0px;">
+ <span style="color: gray;">///</span><span
+ style="color: green;"> "pluginType." Useful for stub objects and/or
+ static mocks</span></p>
+ <p style="margin: 0px;">
+ <span style="color: gray;">///</span><span
+ style="color: green;"> </span><span style="color: gray;"></summary></span></p>
+ <p style="margin: 0px;">
+ <span style="color: gray;">///</span><span
+ style="color: green;"> </span><span style="color: gray;"><param
+ name="pluginType"></param></span></p>
+ <p style="margin: 0px;">
+ <span style="color: gray;">///</span><span
+ style="color: green;"> </span><span style="color: gray;"><param
+ name="stub"></param></span></p>
+ <p style="margin: 0px;">
+ <span style="color: blue;">void</span> Inject(<span
+ style="color: #2b91af;">Type</span> pluginType, <span style="color: blue;">
+ object</span> stub);</p>
+ <p style="margin: 0px;">
+ </p>
+ <p style="margin: 0px;">
+ <span style="color: gray;">///</span><span
+ style="color: green;"> </span><span style="color: gray;"><summary></span></p>
+ <p style="margin: 0px;">
+ <span style="color: gray;">///</span><span
+ style="color: green;"> Method to specify the exact object that will be used
+ for </span>
+ </p>
+ <p style="margin: 0px;">
+ <span style="color: gray;">///</span><span
+ style="color: green;"> "pluginType." Useful for stub objects and/or
+ static mocks</span></p>
+ <p style="margin: 0px;">
+ <span style="color: gray;">///</span><span
+ style="color: green;"> </span><span style="color: gray;"></summary></span></p>
+ <p style="margin: 0px;">
+ <span style="color: gray;">///</span><span
+ style="color: green;"> </span><span style="color: gray;"><typeparam
+ name="T"></typeparam></span></p>
+ <p style="margin: 0px;">
+ <span style="color: gray;">///</span><span
+ style="color: green;"> </span><span style="color: gray;"><param
+ name="target"></param></span></p>
+ <p style="margin: 0px;">
+ <span style="color: blue;">void</span> Inject<T>(T
+ target);</p>
+ </div>
+<!--EndFragment-->
+<hr />
+
+ <h2>Partial Mock the ClassUnderTest</h2>
+ <p>Every so often, I find it useful to create a "<a
+ href="http://ayende.com/wiki/Rhino+Mocks+Partial+Mocks.ashx">partial mock</a>"
+ for the ClassUnderTest. That can be done with the AutoMocker by calling
+ the PartialMockTheClassUnderTest() method:</p>
+<!--
+{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;}??\fs20 \cf3 var\cf0 autoMocker = createAutoMocker<\cf4 ConcreteClass\cf0 >();\par ??\par ?? \cf3 var\cf0 service = autoMocker.Get<\cf4 IMockedService\cf0 >();\par ?? \cf3 var\cf0 service2 = autoMocker.Get<\cf4 IMockedService2\cf0 >();\par ?? \cf3 var\cf0 service3 = autoMocker.Get<\cf4 IMockedService3\cf0 >();\par ??\par ?? autoMocker.PartialMockTheClassUnderTest();}
+-->
+ <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;">
+ <p style="margin: 0px;">
+ <span style="color: blue;">
+ var</span> autoMocker = createAutoMocker<<span style="color: #2b91af;">ConcreteClass</span>>();</p>
+ <p style="margin: 0px;">
+ </p>
+ <p style="margin: 0px;">
+ <span style="color: blue;">
+ var</span> service = autoMocker.Get<<span style="color: #2b91af;">IMockedService</span>>();</p>
+ <p style="margin: 0px;">
+ <span style="color: blue;">
+ var</span> service2 = autoMocker.Get<<span style="color: #2b91af;">IMockedService2</span>>();</p>
+ <p style="margin: 0px;">
+ <span style="color: blue;">
+ var</span> service3 = autoMocker.Get<<span style="color: #2b91af;">IMockedService3</span>>();</p>
+ <p style="margin: 0px;">
+ </p>
+ <p style="margin: 0px;">
+
+ autoMocker.PartialMockTheClassUnderTest();</p>
+ </div>
+<!--EndFragment-->
+<p>Expectations and assertions can be made directly on the AutoMocker.ClassUnderTest
+ property. When the PartialMockTheClassUnderTest() method is called, the
+ underlying value behind ClassUnderTest will be a partial mock, but the
+ AutoMocker will still use mock objects for the dependencies of the class under
+ test.</p>
+ <hr />
</body>
</html>
\ No newline at end of file
Modified: trunk/Source/HTML/DependencyInjection.htm
===================================================================
--- trunk/Source/HTML/DependencyInjection.htm 2009-01-11 22:43:11 UTC (rev 219)
+++ trunk/Source/HTML/DependencyInjection.htm 2009-01-12 03:29:13 UTC (rev 220)
@@ -22,8 +22,7 @@
still thinks it's much cleaner to use DI ;-)</p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
</p>
- <h2 style="margin: 0in 0in 0pt;">
- Dependency Injection</h2>
+ <h2>Dependency Injection</h2>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
</p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
@@ -76,8 +75,7 @@
<hr />
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
<o:p> </o:p></p>
- <h2 style="margin: 0in 0in 0pt;">
- <b style="">Example Problem<o:p></o:p></b></h2>
+ <h2>Example Problem</h2>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
<b style=""><o:p> </o:p></b></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
@@ -277,8 +275,7 @@
<hr />
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
<o:p> </o:p></p>
- <h2 style="margin: 0in 0in 0pt;">
- <b style=""><span class="style1">Constructor Injection</span><o:p></o:p></b></h2>
+ <h2>Constructor Injection</h2>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
<b style=""><o:p> </o:p></b></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
@@ -475,8 +472,7 @@
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
<b style=""><o:p> </o:p></b></p>
<hr />
- <h2 style="margin: 0in 0in 0pt;">
- <b style=""><span class="style1">Setter Injection</span><o:p></o:p></b></h2>
+ <h2>Setter Injection</h2>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
<o:p> </o:p></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
@@ -719,8 +715,7 @@
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
<o:p> </o:p></p>
<hr />
- <h2 style="margin: 0in 0in 0pt;">
- <b style=""><span class="style1">Service Locator</span><o:p></o:p></b></h2>
+ <h2>Service Locator</h2>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
<b style=""><o:p> </o:p></b></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
@@ -875,8 +870,7 @@
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
<o:p> </o:p></p>
<hr />
- <h2 style="margin: 0in 0in 0pt;">
- <span style="">Good for More than Unit Testing<o:p></o:p></span></h2>
+ <h2>Good for More than Unit Testing</h2>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
<b style=""><o:p> </o:p></b></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
@@ -1034,8 +1028,7 @@
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
</p>
<hr />
- <h2 style="margin: 0in 0in 0pt;">
- <span style="">Using a Dependency Injection Tool<o:p></o:p></span></h2>
+ <h2>Using a Dependency Injection Tool</h2>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
</p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
Modified: trunk/Source/HTML/HTML.csproj
===================================================================
--- trunk/Source/HTML/HTML.csproj 2009-01-11 22:43:11 UTC (rev 219)
+++ trunk/Source/HTML/HTML.csproj 2009-01-12 03:29:13 UTC (rev 220)
@@ -66,6 +66,8 @@
<Content Include="InversionOfControl.htm" />
<Content Include="Profiles.htm" />
<Content Include="Scoping.htm" />
+ <Content Include="TableOfContents.htm" />
+ <Content Include="ToC-Bullet-List.xml" />
<Content Include="UsingAttributes.htm" />
<Content Include="AutoWiring.htm" />
<Content Include="ConfiguringStructureMap.htm" />
@@ -113,4 +115,7 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
+ <ItemGroup>
+ <None Include="StructureMap.chm" />
+ </ItemGroup>
</Project>
\ No newline at end of file
Modified: trunk/Source/HTML/InversionOfControl.htm
===================================================================
--- trunk/Source/HTML/InversionOfControl.htm 2009-01-11 22:43:11 UTC (rev 219)
+++ trunk/Source/HTML/InversionOfControl.htm 2009-01-12 03:29:13 UTC (rev 220)
@@ -28,8 +28,7 @@
<o:p> </o:p></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
<o:p> </o:p></p>
- <h2 style="margin: 0in 0in 0pt;">
- <b style=""><span class="style1">Real Life Example</span><o:p></o:p></b></h2>
+ <h2>Real Life Example</h2>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
<b style=""><o:p> </o:p></b></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
@@ -352,8 +351,7 @@
</ul>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
<o:p> </o:p></p>
- <h2 style="margin: 0in 0in 0pt;">
- <b style="">Refactoring to Inversion of Control<o:p></o:p></b></h2>
+ <h2>Refactoring to Inversion of Control</h2>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
<o:p> </o:p></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
@@ -559,8 +557,7 @@
</p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
<o:p> </o:p></p>
- <h2 style="margin: 0in 0in 0pt;">
- <b style="">Other Examples<o:p></o:p></b></h2>
+ <h2>Other Examples</h2>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
<b style=""><o:p> </o:p></b></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
Modified: trunk/Source/HTML/Menu.htm
===================================================================
--- trunk/Source/HTML/Menu.htm 2009-01-11 22:43:11 UTC (rev 219)
+++ trunk/Source/HTML/Menu.htm 2009-01-12 03:29:13 UTC (rev 220)
@@ -13,8 +13,9 @@
<li><a href="http://dimecasts.net/Casts/ByTag/StructureMap">StructureMap on DimeCasts</a></li>
<li><a href="http://teamcity.codebetter.com/viewType.html?buildTypeId=bt5&tab=buildTypeStatusDiv">
StructureMap CI Server on TeamCity.Codebetter.com</a></li>
- <li>Full Table of Contents</li>
+ <li><a href="TableOfContents.htm">Full Table of Contents</a></li>
<li><a href="FeatureList.htm">Feature List</a></li>
+ <li><a href="StructureMap.chm">API Documentation</a></li>
</ul>
<br />
<ul>
Added: trunk/Source/HTML/StructureMap.chm
===================================================================
(Binary files differ)
Property changes on: trunk/Source/HTML/StructureMap.chm
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/Source/HTML/TableOfContents.htm
===================================================================
--- trunk/Source/HTML/TableOfContents.htm (rev 0)
+++ trunk/Source/HTML/TableOfContents.htm 2009-01-12 03:29:13 UTC (rev 220)
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+ <head>
+ <title>Table of Contents</title>
+ <link rel="stylesheet" type="text/css" href="style.css" />
+ <script type="text/javascript" src="jquery-1.2.6.js"></script>
+ <script type="text/javascript" src="structuremap.js"></script>
+ </head>
+ <body>
+ <script language="javascript">
+ $(document).ready(function() {
+ $.get('ToC-Bullet-List.xml', {}, writeTOC, 'HTML');
+ });
+
+ function writeTOC(data) {
+ $('#main').html(data);
+ }
+ </script>
+
+ <div id="main">
+
+ </div>
+ </body>
+</html>
\ No newline at end of file
Added: trunk/Source/HTML/ToC-Bullet-List.xml
===================================================================
--- trunk/Source/HTML/ToC-Bullet-List.xml (rev 0)
+++ trunk/Source/HTML/ToC-Bullet-List.xml 2009-01-12 03:29:13 UTC (rev 220)
@@ -0,0 +1,835 @@
+<div>
+ <ul>
+ <li>
+ <a href="default.htm">Home</a>
+ <ul>
+ <li>
+ <a href="default.htm#section0">Status</a>
+ <ul />
+ </li>
+ <li>
+ <a href="default.htm#section1">Related Links:</a>
+ <ul />
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="FeatureList.htm">Feature List</a>
+ <ul />
+ </li>
+ <li>
+ <a href="QuickStart.htm">A Gentle Quickstart</a>
+ <ul>
+ <li>
+ <a href="QuickStart.htm#section0">Salient Facts</a>
+ <ul />
+ </li>
+ <li>
+ <a href="QuickStart.htm#section1">The Simplest Possible Usage of StructureMap</a>
+ <ul />
+ </li>
+ <li>
+ <a href="QuickStart.htm#section2">Primitive Arguments</a>
+ <ul />
+ </li>
+ <li>
+ <a href="QuickStart.htm#section3">Auto Wiring</a>
+ <ul />
+ </li>
+ <li>
+ <a href="QuickStart.htm#section4">What to do when things go wrong?</a>
+ <ul />
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="Glossary.htm">Glossary</a>
+ <ul>
+ <li>
+ <a href="Glossary.htm#section0">Container</a>
+ <ul />
+ </li>
+ <li>
+ <a href="Glossary.htm#section1">PluginType &amp; PluggedType</a>
+ <ul />
+ </li>
+ <li>
+ <a href="Glossary.htm#section2">Instance</a>
+ <ul />
+ </li>
+ <li>
+ <a href="Glossary.htm#section3">Scoping (or Lifecycle)</a>
+ <ul />
+ </li>
+ <li>
+ <a href="Glossary.htm#section4">Profile</a>
+ <ul />
+ </li>
+ <li>
+ <a href="Glossary.htm#section5">Interceptor</a>
+ <ul />
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="Concepts.htm">Software Design Concepts</a>
+ <ul>
+ <li>
+ <a href="Concepts.htm#section0">Design Concepts</a>
+ <ul />
+ </li>
+ <li>
+ <a href="Concepts.htm#section1">Dependencies</a>
+ <ul />
+ </li>
+ <li>
+ <a href="Concepts.htm#section2">Inversion of Control and Dependency Injection</a>
+ <ul />
+ </li>
+ <li>
+ <a href="Concepts.htm#section3">Auto Wiring</a>
+ <ul />
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="DependencyInjection.htm">Dependency Injection</a>
+ <ul>
+ <li>
+ <a href="DependencyInjection.htm#section0">Dependency Injection</a>
+ <ul />
+ </li>
+ <li>
+ <a href="DependencyInjection.htm#section1">Example Problem</a>
+ <ul />
+ </li>
+ <li>
+ <a href="DependencyInjection.htm#section2">Constructor Injection</a>
+ <ul />
+ </li>
+ <li>
+ <a href="DependencyInjection.htm#section3">Setter Injection</a>
+ <ul />
+ </li>
+ <li>
+ <a href="DependencyInjection.htm#section4">Service Locator</a>
+ <ul />
+ </li>
+ <li>
+ <a href="DependencyInjection.htm#section5">Good for More than Unit Testing</a>
+ <ul />
+ </li>
+ <li>
+ <a href="DependencyInjection.htm#section6">Using a Dependency Injection Tool</a>
+ <ul />
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="InversionOfControl.htm">Inversion of Control</a>
+ <ul>
+ <li>
+ <a href="InversionOfControl.htm#section0">Real Life Example</a>
+ <ul />
+ </li>
+ <li>
+ <a href="InversionOfControl.htm#section1">Refactoring to Inversion of Control</a>
+ <ul />
+ </li>
+ <li>
+ <a href="InversionOfControl.htm#section2">Other Examples</a>
+ <ul />
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="ConfiguringStructureMap.htm">Configuring StructureMap</a>
+ <ul>
+ <li>
+ <a href="ConfiguringStructureMap.htm#section0">Forms of Configuration</a>
+ <ul />
+ </li>
+ <li>
+ <a href="ConfiguringStructureMap.htm#section1">Initializing the Container</a>
+ <ul>
+ <li>
+ <a href="ConfiguringStructureMap.htm#section2">Using the App.Config File</a>
+ </li>
+ <li>
+ <a href="ConfiguringStructureMap.htm#section3">The StructureMap.config File</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="ConfiguringStructureMap.htm#section4">Where and How to Bootstrap StructureMap</a>
+ <ul>
+ <li>
+ <a href="ConfiguringStructureMap.htm#section5">Creating a Bootstrapper</a>
+ </li>
+ <li>
+ <a href="ConfiguringStructureMap.htm#section6">StructureMapConfiguration</a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="RegistryDSL.htm">Registry DSL</a>
+ <ul>
+ <li>
+ <a href="RegistryDSL.htm#section0">The Registry Class</a>
+ <ul>
+ <li>
+ <a href="RegistryDSL.htm#section1">Applying Registry Classes</a>
+ </li>
+ <li>
+ <a href="RegistryDSL.htm#section2">The Registry DSL Methods</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="RegistryDSL.htm#section3">Registering Types</a>
+ <ul>
+ <li>
+ <a href="RegistryDSL.htm#section4">Specifying the Default Instance for a PluginType</a>
+ </li>
+ <li>
+ <a href="RegistryDSL.htm#section5">Specifying Additional Instances for a PluginType</a>
+ </li>
+ <li>
+ <a href="RegistryDSL.htm#section6">Setting the Scoping/Lifecycle for a PluginType</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="RegistryDSL.htm#section7">Registering a "Missing Instance"</a>
+ <ul />
+ </li>
+ <li>
+ <a href="RegistryDSL.htm#section8">Configuring Concrete Types</a>
+ <ul />
+ </li>
+ <li>
+ <a href="RegistryDSL.htm#section9">Working with Open Generic Types</a>
+ <ul />
+ </li>
+ <li>
+ <a href="RegistryDSL.htm#section10">Auto Registration and Assembly ScanningScanning</a>
+ <ul />
+ </li>
+ <li>
+ <a href="RegistryDSL.htm#section11">Setter Injection Policies</a>
+ <ul />
+ </li>
+ <li>
+ <a href="RegistryDSL.htm#section12">Interception</a>
+ <ul />
+ </li>
+ <li>
+ <a href="RegistryDSL.htm#section13">Creating a Profile</a>
+ <ul />
+ </li>
+ <li>
+ <a href="RegistryDSL.htm#section14">Using the Registry DSL Directly in Initializationlization</a>
+ <ul />
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="InstanceExpression.htm">Configuring Instances</a>
+ <ul>
+ <li>
+ <a href="InstanceExpression.htm#section0">Instance Expression</a>
+ <ul>
+ <li>
+ <a href="InstanceExpression.htm#section1">InstanceExpression Operations</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="InstanceExpression.htm#section2">Building with Constructors and Setters</a>
+ <ul>
+ <li>
+ <a href="InstanceExpression.htm#section3">Designating the Type</a>
+ </li>
+ <li>
+ <a href="InstanceExpression.htm#section4">Defining primitive constructor arguments</a>
+ </li>
+ <li>
+ <a href="InstanceExpression.htm#section5">Defining primitive setter properties</a>
+ </li>
+ <li>
+ <a href="InstanceExpression.htm#section6">Overriding Constructor Dependencies</a>
+ </li>
+ <li>
+ <a href="InstanceExpression.htm#section7">Overriding Setter Dependencies</a>
+ </li>
+ <li>
+ <a href="InstanceExpression.htm#section8">Array or Non Primitive Dependencies</a>
+ </li>
+ <li>
+ <a href="InstanceExpression.htm#section9">Primitive Arrays and Dictionaries</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="InstanceExpression.htm#section10">Using a Custom Instance</a>
+ <ul />
+ </li>
+ <li>
+ <a href="InstanceExpression.htm#section11">Using an Externally Constructed Object</a>
+ <ul />
+ </li>
+ <li>
+ <a href="InstanceExpression.htm#section12">Constructing Objects with Lambda Functions</a>
+ <ul />
+ </li>
+ <li>
+ <a href="InstanceExpression.htm#section13">Referencing a Named Instance</a>
+ <ul />
+ </li>
+ <li>
+ <a href="InstanceExpression.htm#section14">Using the Default Instance</a>
+ <ul />
+ </li>
+ <li>
+ <a href="InstanceExpression.htm#section15">Specifying a Prototype Object with Cloning</a>
+ <ul />
+ </li>
+ <li>
+ <a href="InstanceExpression.htm#section16">Specifying a Prototype Object with Serialization</a>
+ <ul />
+ </li>
+ <li>
+ <a href="InstanceExpression.htm#section17">Configuring Conditional Construction</a>
+ <ul />
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="XmlConfiguration.htm">Xml Configuration</a>
+ <ul>
+ <li>
+ <a href="XmlConfiguration.htm#section0">&lt;StructureMap&gt; Element</a>
+ <ul>
+ <li>
+ <a href="XmlConfiguration.htm#section1">Configuring Instances</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="XmlConfiguration.htm#section2">Adding a Default Instance for a PluginType</a>
+ <ul />
+ </li>
+ <li>
+ <a href="XmlConfiguration.htm#section3">Adding Additional Instances for a PluginType</a>
+ <ul />
+ </li>
+ <li>
+ <a href="XmlConfiguration.htm#section4">Defining a Profile</a>
+ <ul />
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="XmlReference.htm">Xml Reference</a>
+ <ul>
+ <li>
+ <a href="XmlReference.htm#section0">&lt;StructureMap&gt; Element</a>
+ <ul />
+ </li>
+ <li>
+ <a href="XmlReference.htm#section1">&lt;Include&gt; Element</a>
+ <ul />
+ </li>
+ <li>
+ <a href="XmlReference.htm#section2">&lt;Assembly&gt; Element</a>
+ <ul />
+ </li>
+ <li>
+ <a href="XmlReference.htm#section3">&lt;Instances&gt; Element</a>
+ <ul />
+ </li>
+ <li>
+ <a href="XmlReference.htm#section4">&lt;Machine&gt; Element</a>
+ <ul />
+ </li>
+ <li>
+ <a href="XmlReference.htm#section5">&lt;PluginFamily&gt; Element</a>
+ <ul />
+ </li>
+ <li>
+ <a href="XmlReference.htm#section6">&lt;DefaultInstance&gt; Element</a>
+ <ul />
+ </li>
+ <li>
+ <a href="XmlReference.htm#section7">&lt;Profile&gt; Element</a>
+ <ul />
+ </li>
+ <li>
+ <a href="XmlReference.htm#section8">&lt;Instance&gt; Element</a>
+ <ul />
+ </li>
+ <li>
+ <a href="XmlReference.htm#section9">&lt;Interceptors&gt; Element</a>
+ <ul />
+ </li>
+ <li>
+ <a href="XmlReference.htm#section10">&lt;Interceptor&gt; Element</a>
+ <ul />
+ </li>
+ <li>
+ <a href="XmlReference.htm#section11">&lt;Override&gt; Element</a>
+ <ul />
+ </li>
+ <li>
+ <a href="XmlReference.htm#section12">&lt;Plugin&gt; Element</a>
+ <ul />
+ </li>
+ <li>
+ <a href="XmlReference.htm#section13">&lt;Setter&gt; Element</a>
+ <ul />
+ </li>
+ <li>
+ <a href="XmlReference.htm#section14">&lt;Source&gt; Element</a>
+ <ul />
+ </li>
+ <li>
+ <a href="XmlReference.htm#section15">&lt;Property&gt; Element</a>
+ <ul />
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="NodeNormalized.htm">Node Normalized Instances</a>
+ <ul>
+ <li>
+ <a href="NodeNormalized.htm#section0">Instance Root Node</a>
+ <ul />
+ </li>
+ <li>
+ <a href="NodeNormalized.htm#section1">Primitive Properties (Strings and basic value types)</a>
+ <ul />
+ </li>
+ <li>
+ <a href="NodeNormalized.htm#section2">Long Strings</a>
+ <ul />
+ </li>
+ <li>
+ <a href="NodeNormalized.htm#section3">Enumeration Properties</a>
+ <ul />
+ </li>
+ <li>
+ <a href="NodeNormalized.htm#section4">Dependency Properties</a>
+ <ul>
+ <li>
+ <a href="NodeNormalized.htm#section5">Inline Definition</a>
+ </li>
+ <li>
+ <a href="NodeNormalized.htm#section6">Reference Definition</a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="AttributeNormalized.htm">Attribute Normalized Instances</a>
+ <ul>
+ <li>
+ <a href="AttributeNormalized.htm#section0">Instance Root Node</a>
+ <ul />
+ </li>
+ <li>
+ <a href="AttributeNormalized.htm#section1">Primitive Properties (Strings and basic value types)</a>
+ <ul />
+ </li>
+ <li>
+ <a href="AttributeNormalized.htm#section2">Long Strings</a>
+ <ul />
+ </li>
+ <li>
+ <a href="AttributeNormalized.htm#section3">Enumeration Properties</a>
+ <ul />
+ </li>
+ <li>
+ <a href="AttributeNormalized.htm#section4">Dependency Properties</a>
+ <ul>
+ <li>
+ <a href="AttributeNormalized.htm#section5">Inline Definition</a>
+ </li>
+ <li>
+ <a href="AttributeNormalized.htm#section6">Reference Definition</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="AttributeNormalized.htm#section7">Non Primitive Array Property</a>
+ <ul />
+ </li>
+ <li>
+ <a href="AttributeNormalized.htm#section8">Primitive Arrays</a>
+ <ul />
+ </li>
+ <li>
+ <a href="AttributeNormalized.htm#section9">Dictionaries and NameValueCollection</a>
+ <ul />
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="ScanningAssemblies.htm">Auto Registration and Type Scanning</a>
+ <ul>
+ <li>
+ <a href="ScanningAssemblies.htm#section0">Using the Scan() Expression</a>
+ <ul />
+ </li>
+ <li>
+ <a href="ScanningAssemblies.htm#section1">Rules for Auto Registering a Type</a>
+ <ul />
+ </li>
+ <li>
+ <a href="ScanningAssemblies.htm#section2">Designating Assemblies </a>
+ <ul />
+ </li>
+ <li>
+ <a href="ScanningAssemblies.htm#section3">Scan all Assemblies in a Given Folder</a>
+ <ul />
+ </li>
+ <li>
+ <a href="ScanningAssemblies.htm#section4">Add All Concrete Types for a PluginType</a>
+ <ul />
+ </li>
+ <li>
+ <a href="ScanningAssemblies.htm#section5">Excluding or Including Types</a>
+ <ul />
+ </li>
+ <li>
+ <a href="ScanningAssemblies.htm#section6">Type Scanning with Attributes</a>
+ <ul />
+ </li>
+ <li>
+ <a href="ScanningAssemblies.htm#section7">Convention Based Type Registration</a>
+ <ul>
+ <li>
+ <a href="ScanningAssemblies.htm#section8">The Default Convention</a>
+ </li>
+ <li>
+ <a href="ScanningAssemblies.htm#section9">Registering Types by Name</a>
+ </li>
+ <li>
+ <a href="ScanningAssemblies.htm#section10">Creating and Using Your Own Convention</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="ScanningAssemblies.htm#section11">Looking for Registries</a>
+ <ul />
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="Scoping.htm">Scoping, Caching, and Lifecycle Management</a>
+ <ul>
+ <li>
+ <a href="Scoping.htm#section0">Setting the Scope in the Registry DSL</a>
+ <ul />
+ </li>
+ <li>
+ <a href="Scoping.htm#section1">Setting the Scope in the Xml Configuration</a>
+ <ul />
+ </li>
+ <li>
+ <a href="Scoping.htm#section2">Setting the Scope with the PluginFamily Attribute</a>
+ <ul />
+ </li>
+ <li>
+ <a href="Scoping.htm#section3">Using a Custom Scope/Lifecycle</a>
+ <ul />
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="UsingAttributes.htm">Using Attributes</a>
+ <ul>
+ <li>
+ <a href="UsingAttributes.htm#section0">Scanning for Classes marked with Attributes</a>
+ <ul />
+ </li>
+ <li>
+ <a href="UsingAttributes.htm#section1">[DefaultConstructor] Attribute</a>
+ <ul />
+ </li>
+ <li>
+ <a href="UsingAttributes.htm#section2">[PluginFamily] Attribute</a>
+ <ul />
+ </li>
+ <li>
+ <a href="UsingAttributes.htm#section3">[Pluggable] Attribute</a>
+ <ul />
+ </li>
+ <li>
+ <a href="UsingAttributes.htm#section4">[SetterProperty] Attribute</a>
+ <ul />
+ </li>
+ <li>
+ <a href="UsingAttributes.htm#section5">[ValidationMethod] Attribute</a>
+ <ul />
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="Profiles.htm">Profiles</a>
+ <ul />
+ </li>
+ <li>
+ <a href="Interception.htm">Interception</a>
+ <ul>
+ <li>
+ <a href="Interception.htm#section0">Intercept a Single Instance</a>
+ <ul>
+ <li>
+ <a href="Interception.htm#section1">Run an Action Against an Object</a>
+ </li>
+ <li>
+ <a href="Interception.htm#section2">Wrap or Substitute the Returned Object</a>
+ </li>
+ <li>
+ <a href="Interception.htm#section3">With a Custom Interceptor</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="Interception.htm#section4">Apply Interception to all Instances of a PluginType</a>
+ <ul />
+ </li>
+ <li>
+ <a href="Interception.htm#section5">Apply Interception to all Types Matching a Criteria</a>
+ <ul />
+ </li>
+ <li>
+ <a href="Interception.htm#section6">Creating a Custom Type Interceptor</a>
+ <ul />
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="ChangingConfigurationAtRuntime.htm">Changing Configuration at Runtime</a>
+ <ul>
+ <li>
+ <a href="ChangingConfigurationAtRuntime.htm#section0">Adding Configuration to an Existing Container</a>
+ <ul />
+ </li>
+ <li>
+ <a href="ChangingConfigurationAtRuntime.htm#section1">Injecting a Single Service at Runtime</a>
+ <ul />
+ </li>
+ <li>
+ <a href="ChangingConfigurationAtRuntime.htm#section2">Injecting a Mock or a Stub at Runtime</a>
+ <ul />
+ </li>
+ <li>
+ <a href="ChangingConfigurationAtRuntime.htm#section3">Ejecting all Instances of a PluginType</a>
+ <ul />
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="RetrievingServices.htm">Retrieving Services</a>
+ <ul>
+ <li>
+ <a href="RetrievingServices.htm#section0">Get a Service by PluginType</a>
+ <ul />
+ </li>
+ <li>
+ <a href="RetrievingServices.htm#section1">Get a Service by PluginType and Name</a>
+ <ul />
+ </li>
+ <li>
+ <a href="RetrievingServices.htm#section2">Get all Instances of a PluginType</a>
+ <ul />
+ </li>
+ <li>
+ <a href="RetrievingServices.htm#section3">"Fill" all of the Dependencies of a Concrete Class</a>
+ <ul />
+ </li>
+ <li>
+ <a href="RetrievingServices.htm#section4">Passing Arguments to StructureMap at Runtime</a>
+ <ul />
+ </li>
+ <li>
+ <a href="RetrievingServices.htm#section5">"Try" to Get an Instance</a>
+ <ul />
+ </li>
+ </ul>
+ </li>
+ <li>
+ <a href="AutoMocker.htm">Using the StructureMap AutoMocker</a>
+ <ul>
+ <li>
+ <a href="AutoMocker.htm#section0">How it Works</a>
+ <ul />
+ </li>
+ <li>
+ <a href="AutoMocker.htm#section1">How it uses Mock Engines</a>
+ <ul />
+ </li>
+ <li>
+ <a href="AutoMocker.htm#section2">Supplying Mocks or Stubs to the AutoMocker</a>
+ <ul />
+ </li>
+ <li>
+ <a href="AutoMocker.htm#section3">Partial Mock the ClassU...
[truncated message content] |