【问题标题】:nunit3 how to include test category in command linenunit3如何在命令行中包含测试类别
【发布时间】:2015-12-05 10:37:19
【问题描述】:
nunit3-console TestData.dll /include:SmokeTests

但是使用 nunit v3 我回来了:

Invalid argument: /include:SmokeTests

我在这里尝试检查命令行参数 http://nunit.org/index.php?p=consoleCommandLine&r=3.0

但页面不存在。有谁知道发生了什么变化?

【问题讨论】:

标签: nunit


【解决方案1】:

因此,如果有人在 NUNIT3 中搜索如何执行此操作:

 --where "cat == SmokeTests" --noresult

由@omer727 链接帮助!

【讨论】:

【解决方案2】:

@omer727 提供的链接已损坏,这是另一个:https://github.com/nunit/docs/wiki/Console-Command-Line

anwser 仍然有效:

--where "cat == SmokeTests"

控制台命令行允许您指定一个过滤器,该过滤器将选择执行哪些测试。这是使用 --where 选项完成的,后跟 NUnit 的测试选择语言 (TSL) 中的表达式,这是一种为此目的而设计的简单的特定于领域的语言。

例子:

nunit3-console mytest.dll --where "cat == Urgent || Priority == High"

更多详情请访问此链接:https://github.com/nunit/docs/wiki/Test-Selection-Language

编辑:

详细的例子可以在相关的SO问题here中找到。

【讨论】:

  • 你能帮我用 AutoRun().Execute() 做这件事吗?我使用类别属性作为.Execute(new String[] { "--where= cat=testname"}); 运行测试现在如何在其中添加--params
  • 如果您在类别中有空格 ` --where "cat == 'Integration Tests'" `
【解决方案3】:

我正在使用 nUnit 3.4,并且

--where "cat != blah"

没用。我必须添加冒号

--where:"cat != blah"

正在从 powershell 运行命令。

【讨论】:

    猜你喜欢
    • 2020-05-12
    • 1970-01-01
    • 1970-01-01
    • 2019-01-10
    • 2021-11-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-04
    相关资源
    最近更新 更多