MSTest找不到新测试 [英] MSTest Not Finding New Tests

查看:102
本文介绍了MSTest找不到新测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用VS2010,我似乎无法添加其他测试方法.如果我这样设置项目

Using VS2010, I can't seem to add additional test methods. If I set up my project like this

[TestMethod]
public void Test1()
{
   Assert.AreNotEqual(0,1);
}

[TestMethod]
public void Test2()
{
   Assert.AreNotEqual(0,1);
}

在测试视图"中显示的唯一测试是Test1.如何确保Test2进入该列表?

The only test that shows up in my Test View is Test1. How do I make sure Test2 gets in to that list?

最初未创建的其他测试不会添加到测试列表中.因此,如果我要在运行测试后添加Test3,则不会添加Test3.

Additional tests that weren't initially created are not added to the list of tests. So if I was to add Test3 after running tests, then Test3 would not get added.

推荐答案

最简单的方法:重新打开解决方案.

Simplest way: Reopen the solution.

您还可以打开测试列表文件(解决方案项目"文件夹中的"vsmdi"文件),然后点击其中的刷新"按钮.

You can also open your test list file (the "vsmdi" file in your Solution Items folder) and hit the "refresh" button there.

有时也可以完全重建您的解决方案.

A full rebuild of your solution works sometimes, too.

这篇关于MSTest找不到新测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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