How to run explicit test cases of Nunit
Asked Answered
I

3

10

My test suite project contains some explicit test cases, now i want to execute the test cases with the help of Nunit-console.exe. When I execute the test cases, the explicit test cases were excluded from the execution. So, I have tried to execute the test cases using the batch file in the following manner.

nunit-console.exe test1.dll
nunit-console.exe test1.dll /include:Expicit

I am executing the above 2 commands with the help of batch file.But i am not able to execute the explicit test cases.

Could you please let me know how to execute explicit test cases with the help of nunit-console.exe

Impudent answered 17/8, 2009 at 14:30 Comment(2)
You should probably add the nunit tag to this question.Ketcham
You might consider a Category instead. /include and /exclude work well with categories. That will remove some of the protection Explicit gives you. For example if you run all tests the ones with categories will be included by default. But if you are looking to be able to just run all the tests without a certain group then Category might be a better bet.Carnal
P
7

Explicit tests can only be run with nunit-console if you name the test or test fixture on the command line, using the /fixture option.

Paget answered 19/8, 2009 at 9:10 Comment(0)
B
1

You have a typo: /include:Exp"l"icit... perhaps this is the cause?

Boatman answered 27/10, 2009 at 22:20 Comment(0)
B
1

This works for me:

First, follow this answer in When running NUnit and specifying a category, can all uncategorized tests be included too? to add a [Category] to the assembly.

Then, where [Explicit] is used, add the same [Category].

Beckner answered 6/1, 2016 at 17:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.