MvcContrib TestHelper fluent ルート テスト API を使用しようとしていますが、奇妙な動作が見られます。.WithMethod(HttpVerb) 拡張メソッドが期待どおりに実行されていないようです。異なる HttpVerbs を受け入れる (2) アクション (同じ名前) を示すコントローラーを次に示します。
[HttpGet]
public ActionResult IdentifyUser()
{
return View(new IdentifyUserViewModel());
}
[HttpPost]
public ActionResult IdentifyUser(IdentifyUserInputModel model)
{
return null;
}
[HttpPost] 属性を使用してアクションにマップする必要があるテストは次のとおりです。
MvcApplication.RegisterRoutes(RouteTable.Routes);
var routeData = "~/public/registration/useridentification/identifyuser"
.WithMethod(HttpVerbs.Post)
.ShouldMapTo<UserIdentificationController>(x => x.IdentifyUser(null));
私のテストでは POST HttpVerb が指定されていますが、常に HttpGet メソッドにルーティングされます。 コントローラーで HttpPost を受け入れるアクションをコメントアウトしても、テスト パスを取得できます。
私がここに欠けているものはありますか?