title: Mock (Moq) with unity container and generics
body: <p>I have a Container interface with a generic resolve method which, when implemented, resolves using Unity.</p>
  
  <pre><code>public interface IContainer
  {
      T Resolve&lt;T&gt;();
  }
  </code></pre>
  
  <p>Currently there is a Mock Container class:</p>
  
  <pre><code>public class MockContainer : IContainer {
      public T Resolve&lt;T&gt;()
      {            
          return default(T);
      }
  }
  </code></pre>
  
  <p>But I want to use Moq for consistency and do the equivalent:</p>
  
  <pre><code>mockContainer
      .Setup(container =&gt; container.Resolve&lt;T&gt;())
      .Returns(default(T));
  </code></pre>
  
  <p>But I get 2 compile errors <code>'T' could not be found</code></p>
  
  <p>Is the Moq syntax wrong, am I missing a reference or can this just not be done?</p>
  
  <p><strong>Edit</strong>
  I know that mocking the container is not ideal. I could resolve each class one-by-one in my setup code.</p>
  
  <p>My question is whether there is some Moq syntax to perform the equivalent of my actual container. </p>