Tuesday, July 17, 2012

MSTest: use subfolders for your deployment items

Out-of-the-box when you have deployment enabled inside your .testsettings file, all files are put directly under the TestResults/Out folder. But what if you want to put your test files in a subfolder? This is something that isn’t possible through the testsettings editor, however it can be accomplished by changing the .testsettings file directly.
TestSettingsEditorDeploymentTab
Right click on the .testsettings file in your solution explorer. 
  1. Select Open With and select XML editor.
  2. Add a deployment item, specifying the relative path as the file name and an outputdirectory value of the directory name.
    <Deployment> 
     <DeploymentItem filename="BuildCustomizations\TestFiles\" outputDirectory="TestFiles\" /> 
    </Deployment>
Now when you execute your tests, MSTest will copy the content of the ‘TestFiles’ folder to 'TestResults/Out/TestFiles before your tests are executed.


Remark: MSTest didn’t pick up this change immediately. I had to restart Visual Studio before it worked.

2 comments:

williamson said...

Hi

Global Incorporate involves researched and knowledgeable infromation which enhaces the facts of Digital Marketing. It highlights on the key aspects of the Digital World together with SEO and Social Media Strategies.

williamson said...

Hi

Global Incorporate involves researched and knowledgeable infromation which enhaces the facts of Digital Marketing. It highlights on the key aspects of the Digital World together with SEO and Social Media Strategies.