0

Due to lack of documentation for xUnit I came here.
I'm trying to find a way of separating my tests into suits. So far I have some tests that interact with database, I'd like to test them separately from my unit tests. Moreover, I'd like to mark the whole classes, I am not mixing unit and integration tests in one class.
The best would be to run specific tests suits for the whole solution, but per project would also be nice.
Is it possible in xUnit? How could I do it?

I use dotnet core 2.2, Rider and xUnit 2.4.0

Vitalii Isaenko
  • 941
  • 1
  • 14
  • 37

1 Answers1

0

For anyone having the same problem, I'm posting an answer taken from the docs Fabio sent a link to in comments.
In my case I will add folders and namespaces respectively with name UnitTests that will contain my unit tests only. Then I will use --filter option to run only tests containing UnitTests part in fully qualified name.
From docs:
dotnet test --filter XUnit - Runs tests whose FullyQualifiedName contains XUnit. Available in vstest 15.1+.

Vitalii Isaenko
  • 941
  • 1
  • 14
  • 37