开发者

How to verify the parameter of an action method with MVCContrib Route TestHelper

I have an action method which has pagination object as parameter

  public override ActionResult Index(Paging paging) 
  {
        .......
        return View(...);
  }

So how could I verify the url to match action method and it's parameter? like below

Paging paging = new DefaultPaging();
"/Search".ShouldMapTo<SearchController>(action => action.Index(paging));

Update

Here is how the route definition looks like, Page,PageSize and Sort are member of the Paging class

routes.MapRoute(controller.Name, string.F开发者_StackOverflow中文版ormat("{0}/{{Page}}/{{PageSize}}/{{Sort}}", controller.Name),
                       controller.Index().AddRouteValues(new DefaultPaging()));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜