【发布时间】:2012-01-30 13:24:02
【问题描述】:
我正在使用控制器扩展,并尝试使用 FakeItEasy (v 1.7.4) 模拟它,如下所示:
A.CallTo(() => controller.RenderView(A<string>.Ignored,A<object>.Ignored,null)).Returns("");
但我收到此错误:
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)
【问题讨论】:
标签: asp.net-mvc unit-testing moq fakeiteasy