protected void TestRouteFail(string url) { RouteCollection routes = new RouteCollection(); routes = new InitAreas(routes).Init(); MvcApplication.RegisterRoutes(routes); RouteData result = routes.GetRouteData(CreateHttpContext(url)); Assert.IsTrue(result == null || result.Route == null); }
protected void TestRouteMatch(string url, string controller, string action, object routeProperties = null, string httpMethod = "GET") { RouteCollection routes = new RouteCollection(); routes = new InitAreas(routes).Init(); MvcApplication.RegisterRoutes(routes); RouteData result = routes.GetRouteData(CreateHttpContext(url, httpMethod)); Assert.IsNotNull(result); Assert.IsTrue(TestIncomingRouteResult(result, controller, action, routeProperties)); }