问题:我的NUnit测试未显示在测试资源管理器中。测试资源管理器(Nunit)中未显示测试
我目前在64位机器上运行Visual Studio Express 2013。目前,我已经安装了“包括NUnit 2.6.4框架的NUnit TestAdapter”。该框架的版本是2.6.4.14350,而测试适配器的版本是2.0.0.0
继这两个线程(NUnit Unit tests not showing in Test Explorer with Test Adapter is installed和Visual Studio 2013 doesn't discover unit tests)故障排除:
目前,“活动的解决方案平台”设置到64位为我的测试项目(Build> Configuration Manager)构建 设置。
“默认处理器架构”指向测试> 测试设置下的64位。
对测试项目中指定的NUnit框架和TestAdapter的引用已经为 。
- 测试项目CS文件包含在正确的地方
- 我试图清理
[TestFixture]
和[Test]
/重建解决方案多次 - 我试图重新启动Visual Studio中多次
- 我已经尝试运行Visual Studio通过“以管理员身份运行”
- 我已经尝试运行NUnit的版本3(框架和测试适配器)
下面是我的合作de:
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Hello_World_Testing
{
[TestFixture]
public class HelloWorldTesting
{
[Test]
public void subtract()
{
int value = 1;
if (value == 1)
{
Assert.Pass();
}
}
[Test]
public void addition()
{
int firstValue = 1;
int secondValue = 2;
Assert.AreEqual(3, firstValue + secondValue);
}
}
}
,他们应该表现出在下拉菜单中的Test下的Visual Studio的输出窗口中。那里有什么吗? –
Hi Rob。在输出下找到0。没有错误消息。 完整信息: ------发现测试已开始------ 发现测试已完成:0找到(0:00:02.6861536) – taylorswiftfan
您可以使用NUnit控制台运行测试吗?它可能会显示更多有用的错误。 –