static Host() { AppDomain.CurrentDomain.DomainUnload += CurrentDomain_DomainUnload; Configuration = ConfigScannerFactory .SelectScanner() .GetConfiguration(); _scenarioRunner = new ScenarioRunner(Configuration, new BddfyTestEngine()); _scenarioRunner.BeforeAllScenarios(); }
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(); }