Run Individual Test from Nunit3-console.exe

前端 未结 1 2057
梦毁少年i
梦毁少年i 2021-02-05 23:54

when i run

nunit3-console.exe (myfilepath)\\dll file

The Console Runner Runs all my tests.

what command do i need to run in order to ru

相关标签:
1条回答
  • 2021-02-06 00:32

    You want to look at the --where command line option to run individual tests or filter your tests. It is new for NUnit 3. The --where option uses the test selection language which is a little bit like SQL for tests.

    nunit-console --where "method =~ /Source.*Test/ && class =~ 'My.Namespace.Classname'" test.dll
    

    For simple filters, you can also use the --test=NAMES option with a simple list of test names separated by commas.

    nunit3-console.exe --test=namespace.class.method test.dll
    

    With TestCase and other data driven tests, the test name for individual tests can be difficult to determine. If that is the case, you can use the --explore option.

    0 讨论(0)
提交回复
热议问题