System unit testing and configuration

In a 2008 command system unit test, how can I load the application config file in the test itself?

I have an app.config in a test project that is referenced by System.Configuration, but when I run the test, it doesn't see the app.config

0


source to share


1 answer


You have a pre-build batch event that copies it from your application directory.

You can add this by right clicking on your test project (or application) and clicking Properties. When the page opens, select "Build Events" from the menu and enter your command, for example:



xcopy ../ app.config ../../ Test / bin / app.config

Or save a copy yourself.

0


source







All Articles