VS 11 Beta代码覆盖率和.testsettings文件 [英] VS 11 Beta Code Coverage and .testsettings files

查看:119
本文介绍了VS 11 Beta代码覆盖率和.testsettings文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我处在一个奇怪的问题22中,如果我选择为VS 2010 SLN创建的.testsettings文件,则不会获得代码覆盖率.但是,如果取消选择.testssettings文件,则会得到代码覆盖,但是不幸的是,现在有许多测试文件,因为部署 .testsettings文件的停止未运行.有什么办法可以让我俩兼得吗?顺便说一句,我尝试同时检查代码覆盖率和代码覆盖率(Visual Studio  2010)诊断程序,但仍然无法获得代码覆盖率结果.一切都不是100%

I'm in a weird catch-22 where if I select my .testsettings files created for our VS 2010 SLN I'm not getting code coverage.  But if I deselect the .testssettings file I get code coverage but unfortunately a number of tests now file because the deployment stop of the .testsettings file isn't getting run.  Is there a way I can get both?  BTW I tried checking both Code Coverage and Code Coverage (Visual Studio 2010) diagnostics but I still get not code coverage results ie. everything is 100% not covered.

推荐答案

基思,

您能否从测试设置"中禁用代码覆盖率和代码覆盖率(Visual Studio 2010)数据收集器,然后将其选择为活动的测试设置",然后使用分析代码覆盖率" 运行"下拉到单位" 测试资源管理器".

Can you please disable both the Code Coverage and Code Coverage (Visual Studio 2010) data collectors from the Test Settings, then select it as the active Test Settings and then use the "Analyze Code Coverage" option under the "Run" drop down in the "Unit Test Explorer".

在测试设置中启用代码覆盖率"的情况下,即使您单击全部运行",也会生成覆盖率数据,但是默认情况下不会在VS中加载覆盖率文件.您将必须打开最新的测试结果"文件夹,并在 在"文件夹中,您应该有可用的.coverage文件.

In the case of when you have Code Coverage enable in test settings, the coverage data will get generated even if you hit "Run All", but the coverage file is not loaded in VS by default. You will have to open the latest Test Results folder and inside the "In" folder, you should have the .coverage file available.

-Ankit


这篇关于VS 11 Beta代码覆盖率和.testsettings文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆