sto usando un estensione del controller, e ho cercato di deridere utilizzando FakeItEasy (v 1.7.4) come questo:è possibile simulare/falsificare un metodo di estensione?
A.CallTo(() => controller.RenderView(A<string>.Ignored,A<object>.Ignored,null)).Returns("");
ma ottengo questo errore:
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)
In alternativa, se si desidera un'opzione gratuita, Moles permette anche beffardo di metodi statici: http: // ricerca .microsoft.com/it-it/projects/pex/ –
Questo potrebbe arrivare a FakeItEasy. Quanto presto, non sono sicuro - https://github.com/FakeItEasy/FakeItEasy/issues/90 –