您想查看--where命令行选项,以运行单个测试或过滤测试。它是NUnit
3的新增功能。该
--where选项使用测试选择语言,有点像SQL进行测试。
nunit-console --where "method =~ /Source.*Test/ && class =~ 'My.Namespace.Classname'" test.dll
对于简单的过滤器,您还可以将该
--test=NAMES选项与简单的测试名称列表(以逗号分隔)一起使用。
nunit3-console.exe --test=namespace.class.method test.dll
对于
TestCase其他数据驱动的测试,可能难以确定各个测试的测试名称。在这种情况下,您可以使用该
--explore选项。



