1
votes

Using VS2015 the Test Explorer allows you to run a single scenario outline.

Test Explorer

Now I need to do the same using NUnit3 console tool (I'm using NUnit as Unit Test Provider).

Currently I'm using the following command in order to run a test using console tool.

"C:\NUnit-3.0.1\bin\nunit3-console.exe" Path.Scripts.dll --test:Fully.Qualified.Name.TestAAAFeature.TestAAA --x86
2

2 Answers

0
votes

I could run a single row of a specflow scenario outline example using the --testlist: option.

# list.txt
TestC112169Feature.TestCase112169("1","atomic",null)

# cmd
"C:\NUnit-3.0.1\bin\nunit3-console.exe" Path.Scripts.dll --testlist:"c:\list.txt" --x86

And that do the trick.

0
votes

First and foresmost, I think you should rename your test cases to be more informative as a best practice.

Coming to your question, you should use filters which can be specified by using a where clause. For running a specific test case, you can use either method or name to filter down to one or more target test case(s).

Just append the following to your command and you should be good to go.

--where "name == 'TestCase11257'"

OR

--where "method == 'TestCase11257'"

or you can even combine multiple filters like

--where "name == 'TestCase11257' || method == 'TestCase11257'"

You can read more about filters here