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()));
精彩评论