Last post Aug 18, 2010 06:08 AM by email@example.com
Aug 18, 2010 04:07 AM|misuk11|LINK
One of my NUnit tests has to read in some values from config files. In my main application this process works perfectly well, however when I run the unit test, the code that reads in the values from the config files doesnt read anything in. Ive tried putting
app.config in my unit test project (I even tried web.config) but nothing seems to work. Are there any special steps involved when reading from config files in an nunit test ?
Aug 18, 2010 06:08 AMfirstname.lastname@example.org|LINK
no need to worry.
add a public property in your appliction and assign it to value from config file and use like in NUnit
public class MyClassFixture
Myclass iobjMyclass = new Myclass();
public void GetProgramDetail()
string strPublic = iobjMyclass.PublicProperty;
//// and use strPublic
catch (Exception ex)
throw new Exception(ex.InnerException.ToString());