title: Unable to resolve an interface with Unity
body: <p><em><strong>Question background:</em></strong></p>
  
  <p>I am using unity to resolve a class and all its dependencies.</p>
  
  <p><em><strong>The issue:</em></strong></p>
  
  <p>I want to pass into the constructor of the classes an interface type through Unity, I'm attempting to achieve this as follows:</p>
  
  <pre><code>public static IFacade UnityNewsFacadeResolver()
     {
             IUnityContainer unityContainer = new UnityContainer();
             unityContainer.RegisterType&lt;IFacade, NewsFacade&gt;();
             IFacade newsFacadeInstance = unityContainer.Resolve&lt;NewsFacade&gt;();
  
             return newsFacadeInstance;
     }
  </code></pre>
  
  <p>The following shows the 'NewsFacade' class that Unity sets the constructor parameter. Note it is passing in a 'NewsStoryHandler' concrete type, I want to pass in the interface this class is based on i.e INewsStoryHandler:</p>
  
  <pre><code>private INewsStoryHandler _NewsStoryHandler;
  
      //*****Unity will only pass in a concrete implementation, I want to pass it as an interface but cannot:******
      public NewsFacade(NewsStoryHandler newsStoryHandler)
      {
          if (newsStoryHandler == null)
          {
              throw new Exception("newsStoryHandler is null at the constrcutor");
          }
  
          _NewsStoryHandler = newsStoryHandler;
      }
  </code></pre>
  
  <p>Currently Unity will not resolve and pass in an Interface type, it has to be a concrete implementation as shown above. This means I cannot Mock the interface when I unit test.</p>
  
  <p>Can someone tell me why Unity will not resolve and pass in a type based on its interface?</p>