static Host() { #if NET45 "Host".Log().DebugFormat("Registering AppDomain DomainUnload event"); AppDomain.CurrentDomain.DomainUnload += (sender, e) => { _scenarioRunner.AfterAllScenarios(); }; #else "Host".Log().DebugFormat("Registering System.Runtime.Loader.AssemblyLoadContext Unloading event"); System.Runtime.Loader.AssemblyLoadContext.Default.Unloading += context => _scenarioRunner.AfterAllScenarios(); #endif var scanner = ConfigScannerFactory.SelectScanner(); Configuration = scanner.GetConfiguration(); _scenarioRunner = new ScenarioRunner(Configuration, new BddfyTestEngine()); _scenarioRunner.BeforeAllScenarios(); }
static void CurrentDomain_DomainUnload(object sender, EventArgs e) { _scenarioRunner.AfterAllScenarios(); }