title: Providing an Implementation of an Interface for Moq to Use
body: <p>Let's say I have the following setup:</p>
  
  <pre><code>public interface IFoo
  {
      string DoSomething();
      string DoAnotherThing();
  }
  
  public sealed class Bar : IFoo
  {
      public string DoAnotherThing() =&gt; "DoAnotherThing";
      public string DoSomething() =&gt; "DoSomething";
  }
  </code></pre>
  
  <p>Using Moq, I would like to mock out one of the methods of <code>Bar</code>, but call the implementation of another one. I know I could do this by creating a wrapper class that delegates to <code>Bar</code>, like so:</p>
  
  <pre><code>public class MockableBar : IFoo
  {
      private readonly IFoo _bar;
      public MockableBar(IFoo bar) =&gt; _bar = bar;
      public virtual string DoAnotherThing() =&gt; _bar.DoAnotherThing();
      public virtual string DoSomething() =&gt; _bar.DoSomething();
  }
  </code></pre>
  
  <p>And then mocking it like so:</p>
  
  <pre><code>var fake = new Moq.Mock&lt;MockableBar&gt;(new Bar()) { CallBase = true };        
  fake.Setup(_ =&gt; _.DoSomething()).Returns("Mock");
  
  Assert.AreEqual("DoAnotherThing", fake.Object.DoAnotherThing());
  Assert.AreEqual("Mock", fake.Object.DoSomething());
  </code></pre>
  
  <p>Is there a more generic way to accomplish this, so I don't have to create a new wrapper class for each of the interfaces I want to test in this mechanism?</p>