title: FakeItEasy Proxy methods calls to real implementation
body: <p>I'm trying to proxy calls to a fake object to the actual implementation. The reason for this is that I want to be able to use the WasToldTo and WhenToldTo of Machine.Specifications which only works on fakes of an interface type.</p>
  
  <p>Therefore I'm doing the following to proxy all calls to my real object.</p>
  
  <pre><code>public static TFake Proxy&lt;TFake, TInstance&gt;(TFake fake, TInstance instance) where TInstance : TFake
  {
      fake.Configure().AnyCall().Invokes(x =&gt; x.Method.Invoke(instance, x.Arguments.ToArray()));
      return fake;
  }
  </code></pre>
  
  <p>I would use that like this.</p>
  
  <pre><code>var fake = Proxy&lt;ISomeInterface, SomeImplementation&gt;(A.Fake&lt;ISomeInterface&gt;(), new SomeImplementation());
  
  //in my assertions using Machine.Specifications (reason I need a fake of an interface)
  fake.WasToldTo(x =&gt; x.DoOperation());
  </code></pre>
  
  <p>The problem however is that this only works for void methods, since the Invokes method is not doing anything with the return value. (Action param instead of Func)</p>
  
  <p>Then I was trying to do this using the WithReturnValue method.</p>
  
  <pre><code>public static TFake Proxy(TFake fake, TInstance instance) where TInstance : TFake
  {
      fake.Configure().AnyCall()..WithReturnType().Invokes(x =&gt; x.Method.Invoke(instance, x.Arguments.ToArray()));
      fake.Configure().AnyCall()..WithReturnType().Invokes(x =&gt; x.Method.Invoke(instance, x.Arguments.ToArray()));
      fake.Configure().AnyCall()..WithReturnType().Invokes(x =&gt; x.Method.Invoke(instance, x.Arguments.ToArray()));
      //etc.
      return fake;
  }
  </code></pre>
  
  <p>However the Invokes method still doesn't work the way I want it (still Action instead of Func). So The return value is still not used.</p>
  
  <p>Is there a way of achieving this with the current latest version?</p>
  
  <p>I already filed an issue at the FakeItEasy github repository. <a href="https://github.com/FakeItEasy/FakeItEasy/issues/435" rel="noreferrer">https://github.com/FakeItEasy/FakeItEasy/issues/435</a></p>