的Visual Studio 2012不承认现有的单元测试 [英] Visual Studio 2012 Not Recognizing Existing Unit Tests

查看:281
本文介绍了的Visual Studio 2012不承认现有的单元测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我previously创建单元测试项目,然后从我的解决办法删除了暂时的。现在,我已经加回来,不是由Visual Studio中检测到我的单元测试,我无法弄清楚如何运行它们。

I previously created a Unit Test Project then removed it from my solution temporarily. Now that I have added it back, my unit tests aren't being detected by Visual Studio and I can't figure out how to run them.

我一直在寻找在网上,我看到有关于测试工具设置了一些解决方案,但它似乎已在2012 VS被删除。

I was looking online and I saw that there are some solutions regarding the "Test Tools" settings, but it seems to have been removed in VS 2012.

有没有人遇到这个问题?如何解决它,所以我可以再次运行我的单元测试?

Has anyone encountered this problem? How can I fix it so I can run my unit tests again?

推荐答案

一个可能的原因,由评论提到啊。乔纳森 - 萨林杰是异步单元测试不正确的签名 - 返回类型必须是一个任务,不能无效的。

A possible cause, mentioned in the comments by AH. and Johnathon Sullinger is an incorrect signature of asynchronous unit tests - the return type must be a task and cannot be void.

另外,还要确保测试项目是在适当的生成配置检查:

Also make sure the test project is checked in the appropriate build configuration:

进入的配置管理器的和在你的电流生成配置打勾为测试项目的复选框。确保事后重建解决方案(如正确地达斯汀贝内加斯指出了评论)。

Go to the Configuration Manager and tick the check box for your test project under your current build configuration. Make sure to rebuild the solution afterwards (as correctly pointed out by Dustin Venegas in the comments).


这篇关于的Visual Studio 2012不承认现有的单元测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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