Bir kontrolör uzantısı kullanıyorum ve ben FakeItEasy böyle (v 1.7.4) kullanarak alay etmeye çalıştı:Bir uzatma yöntemini sahte/sahte yapmak mümkün mü?
A.CallTo(() => controller.RenderView(A<string>.Ignored,A<object>.Ignored,null)).Returns("");
ama bu hatayı alıyorum:
System.NullReferenceException : Object reference not set to an instance of an object.
at System.Object.GetType()
at FakeItEasy.Creation.ProxyGeneratorSelector.MethodCanBeInterceptedOnInstance(MethodInfo method, Object callTarget, ref String failReason)
at FakeItEasy.Configuration.DefaultInterceptionAsserter.AssertThatMethodCanBeInterceptedOnInstance(MethodInfo method, Object callTarget)
at FakeItEasy.Configuration.FakeConfigurationManager.CallTo(Expression`1 callSpecification)
Alternatif statik yöntemini sıkı mock olarak oluşturabilir ve sonra yapılandırabilir, Benler da statik yöntemlerin alaycı verir // araştırma .microsoft.com/tr-us/projects/pex/ –
Bu FakeItEasy için geliyor olabilir. Ne kadar sürede, emin değilim - https://github.com/FakeItEasy/FakeItEasy/issues/90 –