nunit3 how to include test category in command line

六月ゝ 毕业季﹏ 提交于 2019-12-10 01:24:07

问题


nunit3-console TestData.dll /include:SmokeTests

but with nunit v3 I get back:

Invalid argument: /include:SmokeTests

I try to check command line parameters here http://nunit.org/index.php?p=consoleCommandLine&r=3.0

but page does not exist. Anyone know what has changed?


回答1:


So if anyone searching how to do this in NUNIT3:

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

helped by @omer727 link!




回答2:


Link provided by @omer727 is broken, here is another one: https://github.com/nunit/docs/wiki/Console-Command-Line

The anwser still works:

--where "cat == SmokeTests"

The console command-line allows you to specify a filter, which will select which tests are executed. This is done using the --where option, followed by an expression in NUnit's Test Selection Language (TSL), a simple domain-specific language designed for this purpose.

Example:

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

For more details visit this link: https://github.com/nunit/docs/wiki/Test-Selection-Language

EDIT:

The detailed example can be found in the related SO question here.




回答3:


I'm using nUnit 3.4, and

--where "cat != blah"

did not work. I had to add colon

--where:"cat != blah"

Was running the command from powershell.



来源:https://stackoverflow.com/questions/34103853/nunit3-how-to-include-test-category-in-command-line

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!