【问题标题】:Nunit does not run the tests for a specific namespace in an assemblyNunit 不会为程序集中的特定命名空间运行测试
【发布时间】:2012-10-08 14:33:37
【问题描述】:
我有一个包含大量测试的大型程序集。这些测试被分组在不同的命名空间下。我尝试从 nunit-console 运行特定命名空间的测试用例,但没有运行任何测试。这只发生在这个程序集中。它适用于我为测试而创建的示例测试程序集。
可能是什么原因?有什么限制吗?
我使用的命令行命令如下
nunit-console.exe /noshadow /nothread /run:namespace Absolute_path_of_the_dll
【问题讨论】:
标签:
.net
nunit
nunit-console
【解决方案1】:
基于documentation,我希望您使用/fixture 参数:
/fixture 选项后指定的名称可能是 TestFixture 类、旧套件(使用 Suite 属性)或命名空间的名称。如果给定了命名空间,则运行该命名空间下的所有固定装置。此选项也可用于 Visual Studio 或 NUnit 项目。
所以
nunit-console /noshadow /nothread /fixture:Foo.Bar.Baz PathToAssembly.dll