public DriverSetupData( Func <IHttpRequestExecutor, IDriverSetupStrategy> strategyFactory, DriverSetupOptionsBuilder defaultOptionsBuilder) { StrategyFactory = strategyFactory; DefaultOptionsBuilder = defaultOptionsBuilder; }
/// <summary> /// Registers the driver setup strategy factory. /// </summary> /// <param name="browserName">Name of the browser.</param> /// <param name="driverSetupStrategyFactory">The driver setup strategy factory.</param> public static void RegisterStrategyFactory( string browserName, Func <IHttpRequestExecutor, IDriverSetupStrategy> driverSetupStrategyFactory) { browserName.CheckNotNull(nameof(browserName)); driverSetupStrategyFactory.CheckNotNull(nameof(driverSetupStrategyFactory)); DriverSetupOptionsBuilder optionsBuilder = s_browserDriverSetupDataMap.TryGetValue(browserName, out DriverSetupData currentData) ? currentData.DefaultOptionsBuilder : new DriverSetupOptionsBuilder(new DriverSetupOptions(GlobalOptions)); s_browserDriverSetupDataMap[browserName] = new DriverSetupData(driverSetupStrategyFactory, optionsBuilder); }