selenium = new DefaultSelenium(
ConfigurationManager.AppSettings["TestMachine"].ToString(),
4444,
ConfigurationManager.AppSettings["Browser"].ToString(),
ConfigurationManager.AppSettings["URL"].ToString()
);
Is there an efficient way to do this, instead of repeating:
ConfigurationManager.AppSettings[""].ToString()
Pravesh Singh
29-Jan-2014I think a better idea is to write a wrapper class to everything that deals with configuration, especially if you write tests. A simple example might be:
This approach will allow you to mock your configuration when you need it and reduce complexity
So you could proceed with:
or you could inherit your configuration from a List and reduce the typing to:
config["Browser"]