This was quite dramatic as my DB connection strings are stored as settings, and needed these to produce tests against the data. The simpliest way to solve this problem is to add a post-build event to the test project. This psot build event will copy the configuration file to the target destination. The testing suite will then pick up these settings as and when requested.
1. Right click and properties on the test project
2. Click Build Events Tab.
3. Add the following post build event...
copy /Y "$(ProjectDir)app.config" "$(TargetPath).config"
This will ensure your config file is copied to its destination, where your test suite (I.e. NUnit can pick it up).
No comments:
Post a Comment