MSTest copy file to test run folder

前端 未结 6 1162
伪装坚强ぢ
伪装坚强ぢ 2020-12-04 11:33

I\'ve got a test which requires an XML file to be read in and then parsed. How can I have this file copied into the test run folder each time?

The XML file is set to

6条回答
  •  孤街浪徒
    2020-12-04 12:33

    Best solution to me is using testsettings, especially if multiple tests need the same datafiles.

    First create a testsettings file, and add the deployment items you need (file or folder name):

    
      These are default test settings for a local test run.
      
        
        
      
    <...../>
    
    • Running in visual studio, use "select Test Settings File" from "Test\Test Settings" menu to select new testsettings

    • Running mstest, use the /testsettings parameter to have mstest use your testsettings.

提交回复
热议问题