Added RenderRouteHandlerTests

This commit is contained in:
Shannon Deminick
2012-08-14 23:35:34 +06:00
parent d95b688a7f
commit ed4de4465f
9 changed files with 250 additions and 67 deletions

View File

@@ -51,12 +51,7 @@ namespace Umbraco.Web
ModelBinders.Binders.Add(new KeyValuePair<Type, IModelBinder>(typeof(RenderModel), new RenderModelBinder()));
//set routes
var route = RouteTable.Routes.MapRoute(
"Umbraco_default",
"Umbraco/RenderMvc/{action}/{id}",
new { controller = "RenderMvc", action = "Index", id = UrlParameter.Optional }
);
route.RouteHandler = new RenderRouteHandler(ControllerBuilder.Current.GetControllerFactory());
CreateRoutes();
//find and initialize the application startup handlers, we need to initialize this resolver here because
//it is a special resolver where they need to be instantiated first before any other resolvers in order to bind to
@@ -107,6 +102,20 @@ namespace Umbraco.Web
return this;
}
/// <summary>
/// Creates the routes
/// </summary>
protected internal void CreateRoutes()
{
//set routes
var route = RouteTable.Routes.MapRoute(
"Umbraco_default",
"Umbraco/RenderMvc/{action}/{id}",
new { controller = "RenderMvc", action = "Index", id = UrlParameter.Optional }
);
route.RouteHandler = new RenderRouteHandler(ControllerBuilder.Current.GetControllerFactory());
}
/// <summary>
/// Initializes all web based and core resolves
/// </summary>