VS2005 Unit Tests and copying files

Sometimes you need to copy some files to the output folder before executing your application from Visual Studio. This isn't a problem, unless you're going to execute a VS2005 unit test battery, because it creates a custom output folder before launching the test battery, so it's no easy task to move for example a xml file there.

This is an example of how a test output folder looks:
Example output folder

In the Test menu -> Edit Test Run Configurations -> (your .testrunconfig file)
Output folder configuration

Select the Deployment item, and here we are, all the files and directories added will be automatically copied before executing the tests.
Output folder configuration

Many thanks to Sibille for pointing me to the original source of this.


Posted by Kartones on 2007-04-21