title: Validating MVC controller DI registration with Unity
body: <p>I'm trying to add a test that validates that all the MVC controllers in my project can resolve successfully.
  I get them with</p>
  
  <pre><code>MvcControlleractionlist = asm.GetTypes()
              .Where(type =&gt; typeof (System.Web.Mvc.Controller).IsAssignableFrom(type));
  </code></pre>
  
  <p>In the test I try to resolve them with:</p>
  
  <pre><code>foreach (var mvcController in MvcControlleractionlist)
  {
      Container.Resolve(mvcController);
  }
  </code></pre>
  
  <p>The error I get is this:</p>
  
  <p>InnerException = {"The PerRequestLifetimeManager can only be used in the context of an HTTP request. Possible causes for this error are using the lifetime manager on a non-ASP.NET application, or using it in a thread that is not associated with the appropriate synchronizati...</p>
  
  <p>I assume MVC in the background registers all the controllers with the PerRequestLifetimeManager. How can I make MVC think the test is running within an HTTP request?</p>