Skip to content

Instantly share code, notes, and snippets.

@manoj-choudhari-git
Last active March 2, 2023 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manoj-choudhari-git/ba8f23538077d73db0a3865563319c37 to your computer and use it in GitHub Desktop.
Save manoj-choudhari-git/ba8f23538077d73db0a3865563319c37 to your computer and use it in GitHub Desktop.
DOTNET CLI - Commands to Filter Tests
## Run all tests where the fully qualified test name contains the word "Repository"
dotnet test --filter FullyQualifiedName~Repository
## Run all tests where the fully qualified test name does not contain the word "Business"
dotnet test --filter FullyQualifiedName!~Business
## Run all tests where
## the fully qualified test name does not contain the word "Business"
## OR DisplayName is equal to "SomeTest"
dotnet test --filter FullyQualifiedName!~Business|DisplayName=SomeTest
## Run all tests where
## the fully qualified test name does not contain the word "Business"
## AND DisplayName contains "SomeTest"
dotnet test --filter FullyQualifiedName!~Business&DisplayName~SomeTest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment