0

I am trying to use NUnit Category attribute to run a set of tests at a time.

But how to pass the category as an argument while running the tests from command line?

Tried multiple things, but none of them seems to be working:

dotnet test /include Category=AfterReboot mytests.dll --> Error:The argument /include is invalid. Please use the /help option to check the list of valid arguments.

dotnet test --filter Category=AfterReboot mytests.dll --> Error:The argument --filer:category=AfterReboot is invalid. Please use the /help option to check the list of valid arguments.
Mounika
  • 371
  • 4
  • 18

2 Answers2

0

Figured it out. Belor worked.

dotnet test --filter "Category = AfterReboot" mytests.dll

Mounika
  • 371
  • 4
  • 18
0

The correct filter is TestCategory with dotnet 6.0.400

dotnet test --filter TestCategory=CategoryA
Walterwhites
  • 1,287
  • 13
  • 9
  • 1
    This answer was reviewed in the Low Quality Queue. Code only answers are not considered good answers, and are likely to be downvoted and/or deleted because they are less useful to a community of learners. It's only obvious to you. Explain what it does, and how it's different / better than existing answers. – Webdeveloper_Jelle Aug 30 '22 at 11:59
  • Explain what it does, and how it's different / better than existing answers ? Are you serious? the previous answer just does not work. The correct filter is --filter TestCategory, just that. – Walterwhites Aug 31 '22 at 12:51