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()); }
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); }
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() { 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)); }
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); }
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); }
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); }
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); }
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); }
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); }
private void buildEndpointDriver(int port) { _baseAddress = "http://localhost:" + port; UrlContext.Stub(_baseAddress); _endpoints = new EndpointDriver(_urls, _baseAddress); }
public void SetUp() { UrlContext.Stub("/app"); }
public void get_absolute_for_unrooted_url_with_empty_stubbed_root() { UrlContext.Stub(""); "someUrl".ToAbsoluteUrl().ShouldEqual("someUrl"); }
public void TestFixtureSetUp() { UrlContext.Stub(""); }
public void form_for_with_an_url() { UrlContext.Stub("some url"); page.FormFor("some action").Attr("action").ShouldEqual("some url/some action"); }