开发者

MSTest: Deployment Items are not copied to test folder

开发者 https://www.devze.com 2023-04-01 22:28 出处:网络
I have been reading many posts that describe my problem but I cannot find a solution. In my test project I have a folder called, 开发者_JAVA百科\"resources\".

I have been reading many posts that describe my problem but I cannot find a solution. In my test project I have a folder called, 开发者_JAVA百科"resources".

  • I have added this folder to the deployment items configuration.
  • I enabled deployment items
  • I made sure the file is marked "always copy"

I added the DeploymentItem annotment at the class level. The file never makes it the Testing "out" folder.

Can someone tell me what I missed?

[TestClass]
[DeploymentItem(@"resources\descriptor.xml")]
public class MyTests
{
    [TestInitialize]
    public void TestSetup()
    {
         XDocument descriptor = XDocument.Load("descriptor.xml");  //The barfs
    }
}


It seems that the resharper test runner was the problem. If I run my tests using the VS test runner all is well.

0

精彩评论

暂无评论...
验证码 换一张
取 消