Class OptionsTypeProvider
- Namespace
- CSF.Extensions.WebDriver.Factories
- Assembly
- CSF.Extensions.WebDriver.dll
Default implementation of IGetsOptionsType.
public class OptionsTypeProvider : IGetsOptionsType
- Inheritance
-
OptionsTypeProvider
- Implements
- Inherited Members
Constructors
OptionsTypeProvider(ILogger<OptionsTypeProvider>, IGetsWebDriverAndOptionsTypes, ICreatesDriverOptions)
Initialises a new instance of DriverTypeProvider.
public OptionsTypeProvider(ILogger<OptionsTypeProvider> logger, IGetsWebDriverAndOptionsTypes typeProvider, ICreatesDriverOptions optionsFactory)
Parameters
loggerILogger<OptionsTypeProvider>A logger
typeProviderIGetsWebDriverAndOptionsTypesA provider for the concrete types of web driver and options
optionsFactoryICreatesDriverOptionsA factory for instances of OpenQA.Selenium.DriverOptions
Exceptions
- ArgumentNullException
If any parameter is null
Methods
TryGetOptionsType(WebDriverCreationOptions, IConfigurationSection, Type, out Type)
Validates and gets the Type of the implementation of OpenQA.Selenium.DriverOptions implementation indicated by the configuration.
public bool TryGetOptionsType(WebDriverCreationOptions options, IConfigurationSection configuration, Type driverType, out Type optionsType)
Parameters
optionsWebDriverCreationOptionsThe options, as they have been parsed so far
configurationIConfigurationSectionThe configuration section
driverTypeTypeThe type of the Web Driver, as has already been determined by TryGetDriverType(WebDriverCreationOptions, IConfigurationSection, out Type).
optionsTypeTypeIf this method returns true then this is a Type of the driver options, otherwise this value is undefined and must be ignored.
Returns
Remarks
Note that it is valid for the options type to be null if DriverFactoryType is specified. In that scenario, the options type is unused, but it still indicates a valid configuration.