Run all tests in namespace using Nunit3-console.exe

妖精的绣舞 提交于 2019-12-11 00:34:09

问题


After pouring over the NUnit 3 documentation on Test Selection Language and trying a few combinations, I still cannot figure out how to run all the tests within a specific namespace.

The most obvious attempt being:

nunit3-console.exe --where "test == 'MyNamespace.Subnamespace'" Tests.dll

Unfortunately, this reports zero matching tests, although using the --explore options I can see many tests within that namespace.

Do I need to use regular expression/wildcards to accomplish this? The NUnit docs hint otherwise, but given this doesn't work maybe I do.


回答1:


It seems the following works:

nunit3-console.exe --where "test =~ 'MyNamespace.Subnamespace'" Tests.dll

Note the squiggle =~ is a regex operator.

This is a bit of a surprise because the only example mentioning namespaces in the documentation uses the == syntax which, given my original experimentation, would not have any effect.



来源:https://stackoverflow.com/questions/40010519/run-all-tests-in-namespace-using-nunit3-console-exe

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