Esempio n. 1
0
        public void SetUp()
        {
            UrlContext.Reset();
            _appBaseUrl = "Fubu";
            UrlContext.Stub(_appBaseUrl);
            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());
        }
Esempio n. 2
0
        public void SetUp()
        {
            family       = new MapFromWebPathFamily();
            webAppFolder = "MapFromWebPathFamilyTester";
            UrlContext.Stub(webAppFolder);

            expandProp   = ReflectionHelper.GetProperty <TestSettings>(t => t.DefaultPath);
            noExpandProp = ReflectionHelper.GetProperty <TestSettings>(t => t.DoNotExpand);
        }
Esempio n. 3
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());
        }
Esempio n. 4
0
        public void SetUp()
        {
            theHttpRequest = new StandInCurrentHttpRequest();
            UrlContext.Stub("http://server");

            theUrlResolver = new ChainUrlResolver(theHttpRequest);

            theGraph = BehaviorGraph.BuildFrom(registry =>
            {
                registry.Actions.IncludeType <ChainUrlResolverEndpoint>();
            });

            theSimpleChain          = theGraph.BehaviorFor <ChainUrlResolverEndpoint>(x => x.get_index());
            theChainWithRouteParams = theGraph.BehaviorFor(typeof(ChainUrlParams));
        }
Esempio n. 5
0
        public Harness(FubuRuntime runtime, FubuKayakApplication application, string root)
        {
            _runtime     = runtime;
            _application = application;

            var urls = _runtime.Facility.Get <IUrlRegistry>();

            urls.As <UrlRegistry>().RootAt(root);

            UrlContext.Stub(root);

            _remote = new Lazy <RemoteBehaviorGraph>(() => { return(new RemoteBehaviorGraph(root)); });

            _endpoints = new EndpointDriver(urls);
        }
Esempio n. 6
0
        public static void Start()
        {
            _server = new SelfHostHttpServer(5501, GetRootDirectory());
            var runtime = FubuApplication.For <HarnessRegistry>().StructureMap(new Container()).Bootstrap();

            _server.Start(runtime);

            var urls = runtime.Factory.Get <IUrlRegistry>();

            urls.As <UrlRegistry>().RootAt(_server.BaseAddress);

            UrlContext.Stub(_server.BaseAddress);

            _endpoints = new EndpointDriver(urls, _server.BaseAddress);
        }
Esempio n. 7
0
        public EmbeddedFubuMvcServer(FubuApplication application, string physicalPath = null, int port = 5500)
        {
            _application  = application;
            _physicalPath = physicalPath ?? AppDomain.CurrentDomain.BaseDirectory;

            _server  = new SelfHostHttpServer(port, physicalPath);
            _runtime = _application.Bootstrap();
            _server.Start(_runtime);

            _urls = _runtime.Factory.Get <IUrlRegistry>();
            //_urls.As<UrlRegistry>().RootAt(_server.BaseAddress);

            UrlContext.Stub(_server.BaseAddress);

            _services  = _runtime.Factory.Get <IServiceLocator>();
            _endpoints = new EndpointDriver(_urls, _server.BaseAddress);
        }
Esempio n. 8
0
        public static void Start()
        {
            FubuMvcPackageFacility.PhysicalRootPath = GetRootDirectory();

            _server = new SelfHostHttpServer(5500, GetRootDirectory());
            var runtime = bootstrapRuntime();


            _server.Start(runtime);

            var urls = runtime.Factory.Get <IUrlRegistry>();

            urls.As <UrlRegistry>().RootAt(_server.BaseAddress);

            UrlContext.Stub(_server.BaseAddress);

            _endpoints = new EndpointDriver(urls);
        }
Esempio n. 9
0
        public Harness(FubuRuntime runtime, int port)
        {
            _runtime = runtime;

            _server = new SelfHostHttpServer(port, GetApplicationDirectory());
            _server.Start(runtime);
            _port = _server.Port;

            var urls = _runtime.Factory.Get <IUrlRegistry>();

            urls.As <UrlRegistry>().RootAt(_server.BaseAddress);

            UrlContext.Stub(_server.BaseAddress);

            _remote = new Lazy <RemoteBehaviorGraph>(() =>
            {
                return(new RemoteBehaviorGraph(_server.BaseAddress));
            });

            _endpoints = new EndpointDriver(urls);
        }
Esempio n. 10
0
        public EmbeddedFubuMvcServer(FubuRuntime runtime, string physicalPath = null, int port = 5500, StartParameters parameters = null)
        {
            _runtime = runtime;

            parameters      = parameters ?? new StartParameters();
            parameters.Port = port;

            FubuMvcPackageFacility.PhysicalRootPath = physicalPath ?? AppDomain.CurrentDomain.BaseDirectory;

            //_server = WebApplication.Start<Starter>(port: port, verbosity: 1);

            var context = new StartContext
            {
                Parameters = parameters,
            };

            var settings = new KatanaSettings
            {
                LoaderFactory = () => (s => builder => {
                    var host = new FubuOwinHost(_runtime.Routes);
                    builder.Run(host);
                }),
            };

            var engine = new KatanaEngine(settings);

            _server = engine.Start(context);

            _baseAddress = "http://localhost:" + port;

            _urls = _runtime.Factory.Get <IUrlRegistry>();
            _urls.As <UrlRegistry>().RootAt(_baseAddress);

            UrlContext.Stub(_baseAddress);

            _services  = _runtime.Factory.Get <IServiceLocator>();
            _endpoints = new EndpointDriver(_urls);
        }
Esempio n. 11
0
 private void buildEndpointDriver(int port)
 {
     _baseAddress = "http://localhost:" + port;
     UrlContext.Stub(_baseAddress);
     _endpoints = new EndpointDriver(_urls, _baseAddress);
 }
Esempio n. 12
0
 public void SetUp()
 {
     UrlContext.Stub("/app");
 }
Esempio n. 13
0
 public void get_absolute_for_unrooted_url_with_empty_stubbed_root()
 {
     UrlContext.Stub("");
     "someUrl".ToAbsoluteUrl().ShouldEqual("someUrl");
 }
 public void TestFixtureSetUp()
 {
     UrlContext.Stub("");
 }
Esempio n. 15
0
 public void form_for_with_an_url()
 {
     UrlContext.Stub("some url");
     page.FormFor("some action").Attr("action").ShouldEqual("some url/some action");
 }