引用 MSTest 中的文件会因路径不同而在 Team Build 上中断
我们有一组在本地运行良好的用户验收测试(用 MSTest 编写),它们引用了验收测试加载和处理的一些测试文件。
但是,当在团队构建(TFS 2010)上运行时,我们正在使用的文件的路径明显不同,并且无法找到该文件。使用相对路径仍然是这种情况,因为本地测试发生的深度与它们在构建服务器上发生的深度不同。
在测试中引用文件的最佳方式是什么,以便它在本地和团队构建测试运行期间都可以工作。
我考虑过将它们放入团队项目中,但我什至不知道实现这一目标的途径是什么。
任何想法非常感谢!
We have a set of user acceptance tests (written in MSTest) which run fine locally, they're referring to some test files which the acceptance tests load in and process.
However, when running on team build (TFS 2010) the path to the files we're using is obviously different and the file cannot be found. This is still the case with using relative paths as the depth at which the local tests happen is different to the depth at which they happen on the build server.
What's the best way to refer to a file in tests so that it works both locally and during team build test runs.
I've considered putting them in the team project but I don't even know what the path to that will be.
Any ideas much appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试
[DeploymentItemAttribute][1]
Try the
[DeploymentItemAttribute][1]