Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Specify categories while running dotnet test to run unit and integration tests separately

$
0
0

In NUnit.ConsoleRunner, there was an option to specify the categories. For e.g.

  • cat == TestSuite.Unit
  • cat == TestSuite.Integration

In our current application based on .Net 4.5.2 we use these categories to run unit and integration tests separately.

We already have the categories specified through annotations on the test classes 

    [TestFixture]
    [Category("TestSuite.Unit")]
    class UnitTest

We have migrated this application and tests to ASP .Net Core.

I am using the following packages to run NUnit through "dotnet test" by specifying the testrunner as nunit.

"dotnet-test-nunit": "3.4.0-beta-3",
"NUnit": "3.5.0",

When I run "dotnet test" it runs both the unit and integration tests.

How can I specify the category to run while running "dotnet test" so that I can run them separately?

Thanks,

Ranjith


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>