title: NUnit integration tests and dependency injection
body: <p>I'm currently making use of Castle Windsor version 2.1 as my container and would like to perform integration tests using the services registered with it.</p>
  
  <p>Currently, I do this my using the <a href="http://commonservicelocator.codeplex.com/">Common Service Locator</a> to retrieve my service instance and perform my integration tests against it as such:</p>
  
  <pre><code>var myService = ServiceLocator.Current.GetInstance&lt;IMyService&gt;();
  // do stuff with myService
  </code></pre>
  
  <p>What I'd ideally like to do is have my service dependencies injected into my NUnit test fixture automatically. Spring seems to offer <a href="http://www.springframework.net/doc-latest/reference/html/testing.html#testing-fixture-di">this functionality</a>, but I can't locate anything similar using Castle.</p>
  
  <p>Can anyone point me in the right direction?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I'm sure everyone has (valid) points on whether or not this is a <em>good</em> idea; let's just assume that it is in this scenario...Can anyone tell me how this <em>could</em> be accomplished using Windsor?</p>