'Pass NUnit Test Category through command line

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.


Solution 1:[1]

Figured it out. Belor worked.

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mounika