title: ASP MVC DependencyResolver with UnityContainer for Unit testing
body: <p>I'm building an ASP MVC 3 application in which I use Unity as IOC container and I register it on the DependencyResolver.  In my controller I can then do this:</p>
  
  <pre><code>DependencyResolver.Current.GetService(GetType(IViewAllPersonsHandler))
  </code></pre>
  
  <p>Then when I write my unit tests I redefine my mappings in my test to use mocked objects.</p>
  
  <p>A colleague of mine told me that doing this is considered as an Anti Pattern.  </p>
  
  <p>Can anyone tell me whether this is the case and why? </p>
  
  <p>I know that normally I should inject my dependencies in the constructor, but as my controller grows the constructors parameters get lengthy.</p>
  
  <p>Thx</p>