【发布时间】:2019-02-07 00:28:57
【问题描述】:
尽管将 NuGet 中的 NUnit 添加到现有的 .Net Core 项目中,但测试板中没有显示任何单元测试。
注意:我将这些图片作为链接发布,因为我的声誉太低而无法发布图片。这是怎么回事?
- Project > Add NuGet Packages...
- Selected NUnit Package (3.11.0) and clicked "Add Package"
- Checked to see if added to solution
- 在解决方案中创建了一个新的空类文件
- 向此类添加测试
- No tests show up in the test pad
我已尝试重新启动 Visual Studio 并重新安装包。
我也尝试过删除 Project/obj 目录 - 仍然没有成功。
using NUnit.Framework;
namespace ExampleLib
{
[TestFixture]
public class ExampleTestFixture
{
[Test]
public void ExampleTest()
{
Assert.AreEqual(2, 2);
}
}
}
预期:测试填充单元测试板 实际:空测试垫。
【问题讨论】:
标签: c# visual-studio nunit