Machine.Specifications.Mvc の使用中に誰かがこれに遭遇しましたか?
コントローラー アクションの結果をテストする仕様をセットアップします。この場合:
[Subject("User views the dashboard")]
public class When_a_user_views_the_vendors_page
: ManagementContext
{
static ActionResult result;
Because of = () => result = manageController.Vendors();
It should_contain_a_list_of_vendors = () => {
result.ShouldBeAView().And().ShouldHaveModelOfType<List<Core.Vendor>>();
};
}
毎回発生するエラーは次のとおりです。
Machine.Specifications.SpecificationException: System.Web.Mvc.ViewResult 型である必要がありますが、d:\BuildAgent-01 の Machine.Specifications.ShouldExtensionMethods.ShouldBeOfType(Object actual, Type expected) で System.Web.Mvc.ViewResult 型です。 \work\340c36596c29db8\Source\Machine.Specifications\ExtensionMethods.cs:206行目
誰もこれを見たことがありますか?それを解決する簡単な方法はありますか?Machine.Specifications ライブラリで発生しているようです。値を確認するためにデバッグモードで実行しましたが、実際には ViewResult オブジェクトであり、正しいモデルデータでもあります。
前もって感謝します