的代碼:AutoFixture未能CreateAnonymous MVC控制器
IFixture fixture = new Fixture().Customize(new AutoMoqCustomization());
fixture.Customize<ViewDataDictionary>(c => c.Without(x => x.ModelMetadata));
var target = fixture.CreateAnonymous<MyController>();
異常:
System.Reflection.TargetInvocationException: System.Reflection.TargetInvocationException:異常已經通過目標拋出 一個調用。 ---> System.NotImplementedException: 該方法或操作未實現。
MyController()
需要3個參數。
我已經嘗試了回答here中描述的修復程序,但它不起作用。
哪個ASP.NET MVC的版本是您使用? MyController構造函數看起來如何? MyController是否有任何可寫屬性?異常是否提供更多細節(例如堆棧跟蹤)? – 2013-02-20 20:53:46