title: How can I unit test that Windsor can resolve Asp.net MVC3 controller dependencies?
body: <p>Currently I have Windsor controller factory that is working well.  However, I am changing my controllers a bit and having Windsor instantiate more data for controllers.  I forgot to update my Installer class and it failed.</p>
  
  <p>Thus, I realized this is a perfect instance for unit testing, so every time I run my unit tests it will verify that Windsor is set up correctly.</p>
  
  <p>Thus I created the following unit test:</p>
  
  <pre><code>    [TestMethod]
      public void Windsor_Can_Resolve_HomeController_Dependencies()
      {
          // Setup
          WindsorContainer container = new WindsorContainer();
  
          // Act
          HomeController controller = (HomeController)container.Kernel.Resolve(typeof(HomeController));
      }
  </code></pre>
  
  <p>This is exactly the same code that exists in my <code>WindsorControllerFactory.GetControllerInstance()</code> method so I am not sure why this isn't working.  When this runs I get:</p>
  
  <pre><code>Test method MyApp.Tests.Controllers.HomeControllerTest.Windsor_Can_Resolve_HomeController_Dependencies threw exception: 
  Castle.MicroKernel.ComponentNotFoundException: No component for supporting the service MyApp.Controllers.HomeController was found
  </code></pre>
  
  <p>I'm not sure how to tackle this.  The only thing I can think of is that since it's in my test project, and not my Asp.net MVC project it might not be automatically picking up my <code>CommandAndQueryInstaller</code> class, which contains all of my windsor type registration.</p>
  
  <p>Any advice for unit testing windsor dependency configuration?</p>