コード例 #1
0
ファイル: RouteTestBase.cs プロジェクト: ukionik/EasyCMS
        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
ファイル: RouteTestBase.cs プロジェクト: ukionik/EasyCMS
        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));
        }