public void StartUp() { try { var application = _applicationSource.BuildApplication(); var runtime = application.Bootstrap(); _server = new EmbeddedFubuMvcServer(runtime, _physicalPath, _port); EventAggregator.SendMessage(new ApplicationStarted { ApplicationName = _applicationSource.GetType().Name, HomeAddress = _server.BaseAddress, Timestamp = DateTime.Now, Watcher = runtime.Factory.Get <AssetSettings>().CreateFileWatcherManifest() }); } catch (KatanaRightsException e) { EventAggregator.SendMessage(new InvalidApplication { ExceptionText = e.Message, Message = "Access denied." }); } catch (Exception e) { EventAggregator.SendMessage(new InvalidApplication { ExceptionText = e.ToString(), Message = "Bootstrapping {0} Failed!".ToFormat(_applicationSource.GetType().Name) }); } }
public void StartUp() { try { var application = _applicationSource.BuildApplication(); var runtime = application.Bootstrap(); _server = new EmbeddedFubuMvcServer(runtime, _physicalPath, _port); var list = new List <string>(); PackageRegistry.Packages.Each(pak => pak.ForFolder(BottleFiles.WebContentFolder, list.Add)); EventAggregator.SendMessage(new ApplicationStarted { ApplicationName = _applicationSource.GetType().Name, HomeAddress = _server.BaseAddress, Timestamp = DateTime.Now, BottleContentFolders = list.ToArray() }); } catch (Exception e) { EventAggregator.SendMessage(new InvalidApplication { ExceptionText = e.ToString(), Message = "Bootstrapping {0} Failed!".ToFormat(_applicationSource.GetType().Name) }); } }
public ApplicationUnderTest(IApplicationSource source, ApplicationSettings settings, Func <IWebDriver> createWebDriver) { _source = source; _settings = settings; _driver = new Lazy <IWebDriver>(createWebDriver); _container = new Lazy <IContainerFacility>(() => { var app = _source.BuildApplication(); app.ModifyRegistry(r => r.Services(x => { x.ReplaceService <ICurrentHttpRequest>(new StubCurrentHttpRequest { ApplicationRoot = _settings.RootUrl }); })); app.Bootstrap(); return(app.Facility); }); _urls = new Lazy <IUrlRegistry>(() => { var urls = GetInstance <IUrlRegistry>(); urls.As <UrlRegistry>().RootAt(_settings.RootUrl); return(urls); }); }
public ApplicationUnderTest(IApplicationSource source, ApplicationSettings settings, IBrowserLifecycle browser) : this(source.GetType().Name, settings.RootUrl, browser, () => { var app = source.BuildApplication(); return(app.Bootstrap().Factory); }) { }
public ApplicationUnderTest(IApplicationSource source, ApplicationSettings settings, IBrowserLifecycle browser) : this(source.GetType().Name, settings.RootUrl, browser, () => { var app = source.BuildApplication(); return app.Bootstrap().Factory; }) { }
public ApplicationUnderTest(IApplicationSource source, ApplicationSettings settings, Func <IWebDriver> createWebDriver) : this(source.GetType().Name, settings.RootUrl, createWebDriver, () => { var app = source.BuildApplication(); app.ModifyRegistry(r => r.Services(x => { x.ReplaceService <ICurrentHttpRequest>(new StubCurrentHttpRequest { ApplicationRoot = settings.RootUrl }); })); app.Bootstrap(); return(app.Facility); }) { }
private FubuRuntime rebuildFubuMVCApplication() { RouteTable.Routes.Clear(); return(_source.BuildApplication().Bootstrap()); }