Exemplo n.º 1
0
 public ExportUrlRegistry(UrlRegistry inner, IAccessedCache cache, ICurrentHttpRequest currentRequest, FubuDocsDirectories directories)
 {
     _inner          = inner;
     _cache          = cache;
     _currentRequest = currentRequest;
     _directories    = directories;
 }
Exemplo n.º 2
0
        public void SetUp()
        {
            UrlContext.Reset();

            var registry = new FubuRegistry();

            registry.Actions.IncludeType <OneController>();
            registry.Actions.IncludeType <TwoController>();
            registry.Actions.ExcludeMethods(x => x.Method.Name.Contains("Ignore"));

            registry.Routes
            .IgnoreControllerFolderName()
            .IgnoreNamespaceForUrlFrom <UrlRegistryIntegrationTester>()
            .IgnoreClassSuffix("Controller");


            registry.ResolveTypes(x => x.AddStrategy <UrlModelForwarder>());

            // need to do forwards



            graph = registry.BuildGraph();

            var resolver = graph.Services.DefaultServiceFor <ITypeResolver>().Value;

            urls = new UrlRegistry(new ChainResolver((ITypeResolver)resolver, graph), new JQueryUrlTemplate());
        }
Exemplo n.º 3
0
        public void SetUp()
        {
            theHttpRequest = OwinHttpRequest.ForTesting();
            theHttpRequest.FullUrl("http://server/fubu");


            var registry = new FubuRegistry();

            registry.Actions.IncludeType <OneController>();
            registry.Actions.IncludeType <TwoController>();
            registry.Actions.IncludeType <QueryStringTestController>();
            registry.Actions.IncludeType <OnlyOneActionController>();


            registry.Configure(x => { x.TypeResolver.AddStrategy <UrlModelForwarder>(); });

            //registry.Routes.HomeIs<DefaultModel>();

            graph = BehaviorGraph.BuildFrom(registry);

            var resolver    = graph.Services.DefaultServiceFor <ITypeResolver>().Value;
            var urlResolver = new ChainUrlResolver(theHttpRequest);

            urls = new UrlRegistry(new ChainResolutionCache((ITypeResolver)resolver, graph), urlResolver,
                                   new JQueryUrlTemplate(), theHttpRequest);
        }
Exemplo n.º 4
0
        public void SetUp()
        {
            _theCurrentHttpRequest = new StubCurrentHttpRequest {
                TheApplicationRoot = "http://server/fubu"
            };



            var registry = new FubuRegistry();

            registry.Actions.IncludeType <OneController>();
            registry.Actions.IncludeType <TwoController>();
            registry.Actions.IncludeType <QueryStringTestController>();
            registry.Actions.ExcludeMethods(x => x.Name.Contains("Ignore"));

            registry.Routes
            .IgnoreControllerFolderName()
            .IgnoreNamespaceForUrlFrom <UrlRegistryIntegrationTester>()
            .IgnoreClassSuffix("Controller");


            registry.ResolveTypes(x => x.AddStrategy <UrlModelForwarder>());
            registry.Routes.HomeIs <DefaultModel>();

            graph = registry.BuildGraph();

            var resolver = graph.Services.DefaultServiceFor <ITypeResolver>().Value;

            urls = new UrlRegistry(new ChainResolver((ITypeResolver)resolver, graph), new JQueryUrlTemplate(), _theCurrentHttpRequest);
        }
Exemplo n.º 5
0
        public void should_apply_filters()
        {
            var graph        = ObjectMother.DiagnosticsGraph();
            var queryFilters = new List <JsonGridFilter> {
                new JsonGridFilter {
                    ColumnName = "InputModel", Values = new List <string> {
                        typeof(DashboardRequestModel).Name
                    }
                }
            };

            var urlRegistry = new UrlRegistry(new ChainResolver(new TypeResolver(), graph), new NulloUrlTemplate());
            var columns     = new List <IGridColumn <BehaviorChain> > {
                new InputModelColumn()
            };
            var columnBuilders = new List <IGridColumnBuilder <BehaviorChain> > {
                new GridColumnBuilder <BehaviorChain>(columns)
            };
            var gridFilters = new List <IGridFilter <BehaviorChain> > {
                new TestInputModelFilter()
            };

            graph
            .Behaviors
            .Single(chain => gridFilters.Matches(queryFilters, chain))
            .InputType()
            .ShouldEqual(typeof(DashboardRequestModel));
        }
        public void SetUp()
        {
            _theCurrentHttpRequest = new StubCurrentHttpRequest {
                TheApplicationRoot = "http://server/fubu"
            };



            var registry = new FubuRegistry();

            registry.Actions.IncludeType <OneController>();
            registry.Actions.IncludeType <TwoController>();
            registry.Actions.IncludeType <QueryStringTestController>();
            registry.Actions.IncludeType <OnlyOneActionController>();

            registry.Routes
            .IgnoreControllerFolderName()
            .IgnoreNamespaceForUrlFrom <UrlRegistryIntegrationTester>()
            .IgnoreClassSuffix("Controller");


            registry.Configure(x =>
            {
                x.TypeResolver.AddStrategy <UrlModelForwarder>();
            });

            registry.Routes.HomeIs <DefaultModel>();

            graph = BehaviorGraph.BuildFrom(registry);

            var resolver = graph.Services.DefaultServiceFor <ITypeResolver>().Value;

            urls = new UrlRegistry(new ChainResolutionCache((ITypeResolver)resolver, graph), new JQueryUrlTemplate(), _theCurrentHttpRequest);
        }
Exemplo n.º 7
0
        public void SetUp()
        {
            graph = new FubuRegistry(x => x.Actions.IncludeClassesSuffixedWithController()).BuildGraph();

            registry = new UrlRegistry(new ChainResolver(new TypeResolver(), graph), new JQueryUrlTemplate(), new StubCurrentHttpRequest {
                TheApplicationRoot = "http://server/cool"
            });
        }
Exemplo n.º 8
0
        public void SetUp()
        {
            UrlContext.Reset();

            graph = new FubuRegistry(x => x.Actions.IncludeClassesSuffixedWithController()).BuildGraph();

            registry = new UrlRegistry(new ChainResolver(new TypeResolver(), graph), new JQueryUrlTemplate());
        }
Exemplo n.º 9
0
        public void SetUp()
        {
            graph = BehaviorGraph.BuildFrom(x => x.Actions.IncludeClassesSuffixedWithController());

            var request     = OwinHttpRequest.ForTesting().FullUrl("http://server/cool");
            var urlResolver = new ChainUrlResolver(request);

            registry = new UrlRegistry(new ChainResolutionCache(graph), urlResolver, request);
        }
Exemplo n.º 10
0
        public void determine_asset_url_respects_absolute_path()
        {
            var registry = new UrlRegistry(null, null, new StubCurrentHttpRequest {
                TheApplicationRoot = "http://server"
            });

            registry.UrlForAsset(AssetFolder.images, "icon.png")
            .ShouldEqual("http://server/_content/images/icon.png");
        }
Exemplo n.º 11
0
        public void determine_asset_url_complex()
        {
            var file = new AssetFile("shared/jquery.forms.js")
            {
                Folder = AssetFolder.scripts
            };

            UrlRegistry.DetermineRelativeAssetUrl(file)
            .ShouldEqual("_content/scripts/shared/jquery.forms.js");
        }
        public void SetUp()
        {
            graph = BehaviorGraph.BuildFrom(x =>
            {
                x.Actions.IncludeTypesNamed(n => n.StartsWith("UrlCategory"));
            });

            registry = new UrlRegistry(new ChainResolutionCache(new TypeResolver(), graph), new JQueryUrlTemplate(), new StubCurrentHttpRequest {
                TheApplicationRoot = "http://server/app"
            });
        }
Exemplo n.º 13
0
        public void SetUp()
        {
            UrlContext.Stub("");

            graph = new FubuRegistry(x =>
            {
                x.Actions.IncludeTypesNamed(n => n.StartsWith("UrlCategory"));
            }).BuildGraph();

            registry = new UrlRegistry(new ChainResolver(new TypeResolver(), graph), new JQueryUrlTemplate());
        }
        public void SetUp()
        {
            graph = BehaviorGraph.BuildFrom(x => x.Actions.IncludeClassesSuffixedWithController());

            var request = new StubCurrentHttpRequest {
                TheApplicationRoot = "http://server/cool"
            };
            var urlResolver = new ChainUrlResolver(request);

            registry = new UrlRegistry(new ChainResolutionCache(new TypeResolver(), graph), urlResolver, new JQueryUrlTemplate(), request);
        }
Exemplo n.º 15
0
        public void SetUp()
        {
            graph = BehaviorGraph.BuildFrom(x => {
                x.Actions.IncludeType <UrlCategoryController1>();
                x.Actions.IncludeType <UrlCategoryController2>();
                x.Actions.IncludeType <UrlCategoryController3>();
            });

            var request     = OwinHttpRequest.ForTesting().FullUrl("http://server/app");
            var urlResolver = new ChainUrlResolver(request);

            registry = new UrlRegistry(new ChainResolutionCache(graph), urlResolver, request);
        }
        public void register_a_service_by_value()
        {
            var myContainer = new Container();
            var myFacility = new StructureMapContainerFacility(myContainer);

            var registry = new UrlRegistry();

            myFacility.Register(typeof (IUrlRegistry), new ObjectDef
            {
                Value = registry
            });

            myFacility.BuildFactory();

            myContainer.GetInstance<IUrlRegistry>().ShouldBeTheSameAs(registry);
        }
        public void SetUp()
        {
            theHttpRequest = OwinHttpRequest.ForTesting();
            theHttpRequest.FullUrl("http://server/fubu");

            var registry = new FubuRegistry();
            registry.Actions.IncludeType<OneController>();
            registry.Actions.IncludeType<TwoController>();
            registry.Actions.IncludeType<QueryStringTestController>();
            registry.Actions.IncludeType<OnlyOneActionController>();

            graph = BehaviorGraph.BuildFrom(registry);

            var urlResolver = new ChainUrlResolver(theHttpRequest);

            urls = new UrlRegistry(new ChainResolutionCache(graph), urlResolver, theHttpRequest);
        }
Exemplo n.º 18
0
        public void SetUp()
        {
            theHttpRequest = OwinHttpRequest.ForTesting();
            theHttpRequest.FullUrl("http://server/fubu");


            var registry = new FubuRegistry();

            registry.Actions.IncludeType <OneController>();
            registry.Actions.IncludeType <TwoController>();
            registry.Actions.IncludeType <QueryStringTestController>();
            registry.Actions.IncludeType <OnlyOneActionController>();

            graph = BehaviorGraph.BuildFrom(registry);

            var urlResolver = new ChainUrlResolver(theHttpRequest);

            urls = new UrlRegistry(new ChainResolutionCache(graph), urlResolver, theHttpRequest);
        }
        public void SetUp()
        {
            theHttpRequest = OwinHttpRequest.ForTesting();
            theHttpRequest.FullUrl("http://server/fubu");

            var registry = new FubuRegistry();
            registry.Actions.IncludeType<OneController>();
            registry.Actions.IncludeType<TwoController>();
            registry.Actions.IncludeType<QueryStringTestController>();
            registry.Actions.IncludeType<OnlyOneActionController>();

            registry.Configure(x => { x.TypeResolver.AddStrategy<UrlModelForwarder>(); });

            //registry.Routes.HomeIs<DefaultModel>();

            graph = BehaviorGraph.BuildFrom(registry);

            var resolver = graph.Services.DefaultServiceFor<ITypeResolver>().Value;
            var urlResolver = new ChainUrlResolver(theHttpRequest);

            urls = new UrlRegistry(new ChainResolutionCache((ITypeResolver)resolver, graph), urlResolver,
                new JQueryUrlTemplate(), theHttpRequest);
        }
        public void SetUp()
        {
            UrlContext.Stub("");

            graph = new FubuRegistry(x =>
            {
                x.Actions.IncludeTypesNamed(n => n.StartsWith("UrlCategory"));
            }).BuildGraph();

            registry = new UrlRegistry(new ChainResolver(new TypeResolver(), graph), new JQueryUrlTemplate());
        }
        public void SetUp()
        {
            graph = BehaviorGraph.BuildFrom(x => {
                x.Actions.IncludeType<UrlCategoryController1>();
                x.Actions.IncludeType<UrlCategoryController2>();
                x.Actions.IncludeType<UrlCategoryController3>();

            });

            var request = OwinHttpRequest.ForTesting().FullUrl("http://server/app");
            var urlResolver = new ChainUrlResolver(request);

            registry = new UrlRegistry(new ChainResolutionCache(new TypeResolver(), graph), urlResolver, new JQueryUrlTemplate(), request);
        }
        public void SetUp()
        {
            UrlContext.Reset();

            var registry = new FubuRegistry();
            registry.Actions.IncludeType<OneController>();
            registry.Actions.IncludeType<TwoController>();
            registry.Actions.ExcludeMethods(x => x.Method.Name.Contains("Ignore"));

            registry.Routes
                .IgnoreControllerFolderName()
                .IgnoreNamespaceForUrlFrom<UrlRegistryIntegrationTester>()
                .IgnoreClassSuffix("Controller");

            registry.ResolveTypes(x => x.AddStrategy<UrlModelForwarder>());

            // need to do forwards

            graph = registry.BuildGraph();

            var resolver = graph.Services.DefaultServiceFor<ITypeResolver>().Value;

            urls = new UrlRegistry(new ChainResolver((ITypeResolver) resolver, graph), new JQueryUrlTemplate());
        }
        public void SetUp()
        {
            _theCurrentHttpRequest = new StubCurrentHttpRequest{
                TheApplicationRoot = "http://server/fubu"
            };

            var registry = new FubuRegistry();
            registry.Actions.IncludeType<OneController>();
            registry.Actions.IncludeType<TwoController>();
            registry.Actions.IncludeType<QueryStringTestController>();
            registry.Actions.IncludeType<OnlyOneActionController>();

            registry.Routes
                .IgnoreControllerFolderName()
                .IgnoreNamespaceForUrlFrom<UrlRegistryIntegrationTester>()
                .IgnoreClassSuffix("Controller");

            registry.Configure(x =>
            {
                x.TypeResolver.AddStrategy<UrlModelForwarder>();
            });

            registry.Routes.HomeIs<DefaultModel>();

            graph = BehaviorGraph.BuildFrom(registry);

            var resolver = graph.Services.DefaultServiceFor<ITypeResolver>().Value;
            var urlResolver = new ChainUrlResolver(_theCurrentHttpRequest);

            urls = new UrlRegistry(new ChainResolutionCache((ITypeResolver) resolver, graph), urlResolver, new JQueryUrlTemplate(), _theCurrentHttpRequest);
        }
Exemplo n.º 24
0
 public void determine_asset_url_respects_absolute_path()
 {
     var registry = new UrlRegistry(null, null, new StubCurrentHttpRequest{TheApplicationRoot = "http://server"});
     registry.UrlForAsset(AssetFolder.images, "icon.png")
         .ShouldEqual("http://server/_content/images/icon.png");
 }
        public void SetUp()
        {
            _theCurrentHttpRequest = new StubCurrentHttpRequest{
                TheApplicationRoot = "http://server/fubu"
            };

            var registry = new FubuRegistry();
            registry.Actions.IncludeType<OneController>();
            registry.Actions.IncludeType<TwoController>();
            registry.Actions.IncludeType<QueryStringTestController>();
            registry.Actions.ExcludeMethods(x => x.Method.Name.Contains("Ignore"));

            registry.Routes
                .IgnoreControllerFolderName()
                .IgnoreNamespaceForUrlFrom<UrlRegistryIntegrationTester>()
                .IgnoreClassSuffix("Controller");

            registry.ResolveTypes(x => x.AddStrategy<UrlModelForwarder>());

            graph = registry.BuildGraph();

            var resolver = graph.Services.DefaultServiceFor<ITypeResolver>().Value;

            urls = new UrlRegistry(new ChainResolver((ITypeResolver) resolver, graph), new JQueryUrlTemplate(), _theCurrentHttpRequest);
        }
        public void SetUp()
        {
            UrlContext.Stub("");

            graph = new FubuRegistry(x =>
            {
                x.Applies.ToThisAssembly();
                x.Actions.IncludeTypesNamed(n => n.StartsWith("UrlCategory"));
            }).BuildGraph();

            registry = new UrlRegistry(new ChainResolver(new TypeResolver(), graph));
        }
        public void SetUp()
        {
            graph = BehaviorGraph.BuildFrom(x =>
            {
                x.Actions.FindBy(source => {
                   source.IncludeTypesNamed(n => n.StartsWith("UrlCategory"));
                });

            });

            var request = OwinHttpRequest.ForTesting().FullUrl("http://server/app");
            var urlResolver = new ChainUrlResolver(request);

            registry = new UrlRegistry(new ChainResolutionCache(new TypeResolver(), graph), urlResolver, new JQueryUrlTemplate(), request);
        }
        public void SetUp()
        {
            graph = new FubuRegistry(x =>
            {
                x.Actions.IncludeTypesNamed(n => n.StartsWith("UrlCategory"));
            }).BuildGraph();

            registry = new UrlRegistry(new ChainResolutionCache(new TypeResolver(), graph), new JQueryUrlTemplate(), new StubCurrentHttpRequest{TheApplicationRoot = "http://server/app"});
        }
Exemplo n.º 29
0
 public DefaultPathResolver(UrlRegistry url_registry)
 {
     this.url_registry = url_registry;
 }
        public void SetUp()
        {
            graph = BehaviorGraph.BuildFrom(x =>
            {
                x.Actions.FindBy(source => {
                   source.IncludeTypesNamed(n => n.StartsWith("UrlCategory"));
                });

            });

            var request = new StubCurrentHttpRequest { TheApplicationRoot = "http://server/app" };
            var urlResolver = new ChainUrlResolver(request);

            registry = new UrlRegistry(new ChainResolutionCache(new TypeResolver(), graph), urlResolver, new JQueryUrlTemplate(), request);
        }
Exemplo n.º 31
0
 public HomeController(UrlRegistry urls)
 {
     _urls = urls;
 }