NUnit没有运行我的新测试

时间:2012-02-28 21:06:06

标签: c# unit-testing nunit

我在NUnit中的新测试以蓝色字体显示在“测试列表”中。我无法运行它。

这是阙列表。 enter image description here

这是我的班级。我找不到任何错误,甚至与其他测试类不同。

enter image description here

请!有人知道发生了什么吗?

3 个答案:

答案 0 :(得分:9)

您的测试夹具类不是public。如果您未指定public class YouClass,则YourClass将为internal,并且不能由NUnit运行。

答案 1 :(得分:3)

最后我使用了NUnit,你的测试类需要公开。您的EmailBaseGerar未指定它是公开的,并且正在获取defaulted to internal

答案 2 :(得分:1)

您是否需要使用nunit控制台中包含的类别修饰testfixture?此外,公开测试夹具类也没有坏处。