we use the nunit.exe application to run our (integration) test
Now I am experiencing a problem that the connection string is not retrieved from app.config from the dll where the test code is located.
This sounds logical because nunit.exe is a starting application, not a test dll (it worked when I ran tests from the visual studio testframework, by the way), but should I set the line lines to nunit. exe.config?
I tried to install them in the test code (works for appsettings: ConfigurationManager.AppSettings.Set("DownloadDirectory", mDir);)as follows:
ConfigurationManager.ConnectionStrings.Add(conset);(where consetis the object ConnectionStringSettings), but then I get an error message that the connectionstrings section is read-only.
What should I do to use string values in my test?
EDIT: we use an entity structure, so we cannot put the connection string in the application settings, because it reads directly from the section, I could not find a way around this behavior.
source
share