FakeItEasy Proxy methods calls to real implementation
问题 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. Therefore I'm doing the following to proxy all calls to my real object. public static TFake Proxy<TFake, TInstance>(TFake fake, TInstance instance) where TInstance : TFake { fake.Configure().AnyCall().Invokes(x => x.Method.Invoke(instance, x.Arguments.ToArray()));