Task ISubSystem.Start() { return(Task.Factory.StartNew(() => { var settings = StoryTellerEnvironment.Get <SerenityEnvironment>(); WebDriverSettings.Import(settings); FubuMvcPackageFacility.PhysicalRootPath = _settings.PhysicalPath; _runtime = _runtimeSource(); var browserLifecycle = WebDriverSettings.GetBrowserLifecyle(ChooseBrowserType()); _hosting = _settings.RootUrl.IsEmpty() ? (ISerenityHosting) new KatanaHosting() : new ExternalHosting(); _application = _hosting.Start(_settings, _runtime, browserLifecycle); _applicationAlterations.Each(x => x(_application)); _binding = _application.Services.GetInstance <BindingRegistry>(); _bindingRegistrations.Each(x => x(_binding)); configureApplication(_application, _binding); _contextualProviders = _runtime.Factory.GetAll <IContextualInfoProvider>(); _runtime.Facility.Register(typeof(IApplicationUnderTest), ObjectDef.ForValue(_application)); _runtime.Facility.Register(typeof(IRemoteSubsystems), ObjectDef.ForValue(this)); })); }
private void SetupApplicationHost() { if (_externalHosting == null) { _externalHosting = !_settings.RootUrl.IsEmpty(); } _hosting = _externalHosting.Value ? (ISerenityHosting) new ExternalHosting() : new KatanaHosting(); }
Task ISubSystem.Stop() { return(Task.Factory.StartNew(() => { if (_runtime != null) { _runtime.SafeDispose(); _runtime = null; } if (_application != null) { _application.Teardown(); _application = null; } if (_hosting != null) { _hosting.Shutdown(); _hosting = null; } })); }
public FubuMvcSystem(ApplicationSettings settings, Func<FubuRuntime> runtimeSource) { _settings = settings; _runtimeSource = runtimeSource; _hosting = settings.RootUrl.IsEmpty() ? (ISerenityHosting) new SelfHosting() : new ExternalHosting(); resetApplication(); }