public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute(Ssl.Remove, "bullfrog-plain", "bullfrogs"); var routeOptions = new SslHelpers.RouteOptions(); routeOptions.SetOptionByController(Ssl.Add, "securethis"); routes.MapRoute(Ssl.Add, "bullfrog-secure", "bullfrogs"); routes.MapRoute("bullfrog-rel", "bullfrogs"); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults ); }
public void DoSetup() { OptionReset.Do(); _routeOptions = new RouteOptions(); _routeCollection = new RouteCollection(); var requestContextRouteData = new RouteData(); requestContextRouteData.Values["controller"] = "unittest"; var requestContext = new RequestContext(new FakeHttpContextBase(), requestContextRouteData); _urlHelper = new UrlHelper(requestContext, _routeCollection); }