Strange behaviour of VS2005 with local test configuration
Hi,
we are developing a project using a test-driven approach, so unit testing is vital for us
The assembly we are testing needs some folders (with xml and other files), so we created a local test configuration (.testrunconfig file) and added it into solution.
We edited the local test configuration file and added the following line:
<keytype="Microsoft.VisualStudio.TestTools.Common.DeploymentItem">
<pathtype="System.String">Configuration\</path>
<outputDirectorytype="System.String">Configuration\</outputDirectory>
</key>
<value />
We expected to have the folder Configuration and its subfolders and files copies into the folder that the test is running, but in factit does not work!
If we see the folder when the tests run, we see that a folder Configuration is created, and inside the folder Configuration a bin\Debug (or bin\Release) folder is created too. Inside this bin\Release folder a new folder Configuration is created, and this folder contains all the files we need.
So, the files instead to be in <TEST_EXEC_PATH>\Configuration\ are located in <TEST_EXEC_PATH>\Configuration\bin\release\Configuration\. Of course our tests does not work.
We tried to use mstest, and if we go to our solution directory and run the mstest command:
mstest /runconfig:myconfig.testrunconfig /tescontainer:bin\release\MyAssembly.dll but it does not work (do the same as VS2005)...
... BUT if we go to bin\release folder and type
mstest /runconfig:..\..\myconfig.testrunconfig /testcontainer:MyAssembly.dll it WORKS correclty!!!
We tried this in a Win2K with VS2005 SP1 and XP with VS2005 SP1 with same resultss...
... but in a Windows Vista with VS2005 SP1 + SP1 Update for vista... works fine!!! Using VS2005 the folder is correctly copied and using mstest (does not matter if its called from solution directory or in bin\relase directory) it works well too!!
Someone understand what is happening?
Many thanx,
edu
Hi Edu,
Have you tried modifying the configuration file through Visual Studio? Here's some information on using Visual Studio to Add a new Test Run Configuration and setting it up:
http://msdn2.microsoft.com/en-us/library/ms182475(VS.80).aspx
One manual Modification I had to make to the Test Run Configuration file to get it to Deploy to a specific folder is this:
Original:
<outputDirectory type="System.String" />
Change:
<outputDirectory type="System.String" >Configuration\</outputDirectory>
See if making a new Test Run Configuration and then using VS to add your Deployment Directory fixes the problem. If this doesn't work for you, or if I'm not understanding something let me know.
Thanks,
Rusty