public static IAutomationController GetEmuAutomationController(ScenarioContext context, IConfiguration configuration) { Assert.That(context != null); Assert.That(configuration != null); lock (context) { IAutomationController emu = null; if (context.TryGetValue(EmuControllerKey, out emu)) { return(emu); } emu = Server.Core.Loader.LoadFrom(configuration.AutomationControllerName); emu.Trace += (sender, args) => StepFlowOutputHelpers.Write(args.Message); emu.Start( configuration.ControllerInitialisationString, configuration.AutomationIdentification); context[EmuControllerKey] = emu; return(emu); } }