我正在使用带有区域的MVC 2.为了测试路由,我使用的是MvcContrib.
这是测试代码:
[Test]
public void Home()
{
MvcApplication.RegisterRoutes(RouteTable.Routes);
"~/".ShouldMapTo<HomeController>(x => x.Login("Nps"));
}
Run Code Online (Sandbox Code Playgroud)
我不知道如何调用存储在Regions中的路由定义.调用AreaRegistration.RegisterAllAreas()不是一个选项,因为它给出了一个例外.
谢谢Revin