I think it’s best to write a wrapper class with everything related to configuration, especially if you are writing tests. A simple example would be:
public interface IConfigurationService
{
string GetValue(string key);
}
This approach allows you to mock your configuration when you need it and reduce complexity.
So you can continue:
public void SelTest(IConfigurationService config)
{
var selenium = new DefaultSelenium(config.GetValue("TestMachine"),
4444, config.GetValue("Browser"), config.GetValue("URL"));
}
or you can inherit your configuration from the list and reduce text input:
config["Browser"]
source
share