views:

28

answers:

1

I am working with Visual Studio 2010 and it's integrated testing functionality.
I have an XML file in my project which is set to copy to the output directory. I can access the file just fine when I compile and run the project. But it doesn't exist when I attempt to access it within a TestMethod.

It looks like the test is run with the working directory set to an "Out" directory created within the TestResults directory. I can set a breakpoint before I use the file. If I then copy the file into this "Out" directory and continue running the test it accesses the file properly. But that is not really how I want my automated tests to function.

Is it possible to tell VS to copy the build directory into this working directory?

A: 

I found somewhat of a solution. Though I'm not too happy with it.

Under the Test->Edit Test Settings I edit the current settings. Under the Deployment tab, check the Enable deployment checkbox. In the Additional files and directories to deploy add your bin\Debug directory (looks something like src\LocalModels.test\bin\Debug)

I suppose you could add each file you need and it would be a bit faster. It all seems a bit ridiculous.

oillio