Saturday 22 March 2014

Configure Test Deployment in VS Test Case

Unit test is using App.config file for all configuration and application value but there is another input configuration XML(xyz.xml)  placed in “Config” folder. Config Folder is just as Sub folder for Unit test.  When Unit test run all the Cofig folder copied to out folder, their new “Config” folder created but xyz.xml not copied to this folder. Its because as per the configuration file copy its not assigned the path for copied file path.
Easiest way to accomplish deploying;
  • Right click on .testrunconfig file in solution explorer.  As such  LocalTestRun.testrunconfig.
  • Select and Open With and select XML editor
  • Add a deployment item, specifying the relative path as the file name and an outputdirectory value of the directory name. 
 <Deployment>
  <DeploymentItem filename="Services\Identity\Claim\ClaimService.Test\configuration\" outputDirectory="config\" />
</Deployment>

No comments:

Post a Comment