title: Fake extension method using exact arguments
body: <p>I am writing tests for our C# 7 application and struggle with mocking an Extension method. I am using TypeMock 8.6.10.3.</p>
  
  <p>Here is a simplified example:</p>
  
  <pre><code>internal class InnerClass
  {
    private readonly string _description;
  
    public InnerClass(string description)
    {
      _description = description;
    }
  
    public string GetDescription()
    {
      return _description;
    }
  }
  
  internal class OuterClass
  {  
    public void DoSthWithExtension(int someNumber)
    {
      var innerClass = new InnerClass("InnerClassDescription");
      innerClass.Extension(someNumber);
    }
  }
  
  internal static class Extensions
  {
    public static void Extension(this InnerClass innerClass, int someNumber)
    {
      var d = innerClass.GetDescription();
    }
  }
  
   public void TestExtension()
  {
    // I want to fake the method "InnerClass.Extension()"
    // which is called by "OuterClass.DoSthWithExtension()".
    // I don't have access to the InnerClass instance though.
    // So unfortunately I have to fake them all.
    var fakedInnerClasses = Isolate.Fake.AllInstances&lt;InnerClass&gt;();
  
    Isolate.WhenCalled(() =&gt; Extensions.Extension(fakedInnerClasses, 11)).WithExactArguments().DoInstead(
      c =&gt;
      {
        // The test doesn't go in here. The second parameter is correct,
        // the first one obviously not. But what is expected as a first parameter then?
  
        var oc2 = new OuterClass();
  
        // Here I call InnerClass.Extension() again.
        // The test should now go into the faked method underneath.
        oc2.DoSthWithExtension(22);
      });
  
    Isolate.WhenCalled(() =&gt; Extensions.Extension(fakedInnerClasses, 22)).WithExactArguments().DoInstead(
      c =&gt;
      {
        // As above, the test code doesn't go in here.
      });
  
    // In here an instance of InnerClass is created and
    // InnerClass.Extension(11) is called.
    var oc1 = new OuterClass();
    oc1.DoSthWithExtension(11);
  }
  </code></pre>
  
  <p>As the <code>this</code> parameter of the Extension method I choose the faked instances of InnerClass. Thats what I assume is needed. But TypeMock does not bring me into the faked method. Obviously its the wrong parameter. But which one should I choose then?</p>