machine.specifications.mvc sexbeaview()は、有効なviewsultsでも常に失敗します

StackOverflow https://stackoverflow.com/questions/2314773

  •  22-09-2019
  •  | 
  •  

質問

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のタイプである必要がありますが、system.web.mvc.viewresult at machine.specifications.shouldextensionmethods.shouldbeoftype(d: buildagent-01のshouldbeoftype work 340c36596c29db8 source machine.specifications extensionmethods.cs:行206

誰かがこれを見たことがありますか?解決する簡単な方法はありますか? Machine.specifications Libraryで発生しているようです。私はそれをデバッグモードで実行して値をチェックしました。実際、それらは実際にはオブジェクトを視聴することであり、正しいモデルデータも均等です。

前もって感謝します

役に立ちましたか?

解決

Okay... Silly problem. (I knew it would be). I've recently begun experimenting with MVC2. Machine.Specifications.Mvc out of the box is wired to 1.0;

I re-referenced Machine.Specifications.Mvc to Mvc2, and it worked like a charm.

doh! :)

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top