Ejemplo n.º 1
0
        public RoutingTests()
        {
            Routes = new RouteCollection();

            var adminAreaRegistration = new AdminAreaRegistration();
            var areaRegistrationContext = new AreaRegistrationContext(adminAreaRegistration.AreaName, Routes);
            adminAreaRegistration.RegisterArea(areaRegistrationContext);

            RouteConfig.RegisterRoutes(Routes);
        }
Ejemplo n.º 2
0
        public RoutingTests()
        {
            Routes = new RouteCollection();
            var routesModule = new RoutesModule(Routes);

            var adminAreaRegistration = new AdminAreaRegistration();
            var areaRegistrationContext = new AreaRegistrationContext(adminAreaRegistration.AreaName, Routes);
            adminAreaRegistration.RegisterArea(areaRegistrationContext);

            var methodInfo = typeof (RoutesModule).GetMethod("Load", BindingFlags.NonPublic | BindingFlags.Instance );
            methodInfo.Invoke(routesModule, new object[] {null});
        }
Ejemplo n.º 3
0
        public RoutingTests()
        {
            Routes = new RouteCollection();

            var httpContextBase = Substitute.For<HttpContextBase>();
            httpContextBase.Server.MapPath(Arg.Any<string>()).Returns(@"c:\folderthatdoesntexist");
            var adminAreaRegistration = new AdminAreaRegistration(new Lazy<HttpContextBase>(()=>httpContextBase));
            var areaRegistrationContext = new AreaRegistrationContext(adminAreaRegistration.AreaName, Routes);
            adminAreaRegistration.RegisterArea(areaRegistrationContext);

            RouteConfig.RegisterRoutes(Routes);
        }