public void TestConstructorAndCleanup() { var applicationConfig = ApplicationConfigBuilder .Create() .WithApplicationName(ApplicationName) .BuildApplicationConfig(); var bootstrapper = new ApplicationBootstrapper(applicationConfig); bootstrapper.Dispose(); }
/// <summary> /// Helper method to stop the bootstrapper, if needed /// </summary> private async Task StopBootstrapperAsync() { // TODO: What to disable here? Ist un-registering the exception handlers here smart? // Unhook unhandled exceptions in the Dispatcher DispatcherUnhandledException -= HandleDispatcherException; // Unhook unhandled exceptions in the AppDomain AppDomain.CurrentDomain.UnhandledException -= HandleAppDomainException; // Unhook unhandled exceptions in tasks TaskScheduler.UnobservedTaskException -= HandleTaskException; // Shutdown Caliburn Micro _caliburnMicroBootstrapper.Shutdown(); await _bootstrapper.ShutdownAsync().ConfigureAwait(true); // Make sure everything is disposed (and all disposables which were registered via _bootstrapper.RegisterForDisposal() are called) _bootstrapper.Dispose(); }