The way I have my unit test set up is that a user can run the executable and select a dataset to use. This information is stored in app.config, however when I try to access app.config when running the unit test with Gallio Icarus it doesn’t work.
Edit:
I got the field to bind to an Application property however when I call Properties.Settings.Default.Save(); it doesn’t seem to do anything. The app.exe.config does not change and the changes does not persist.
app.configis the file that corresponds to theMyProgramme.exe.configfile that the programme reads on start up. This can be accessed via theConfigurationobject in theSystem.Configurationnamespace and assembly.Properties.Settings.Defaultcorresponds to the fileuser.configthat your programme will generate when you callProperties.Settings.Default.Save()So including the
app.configfile in the tests won’t affectProperties.Settings.Default.For more information see Using Settings