예제 #1
0
        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);
        }
예제 #2
0
        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));
        }