How to run a single [Theory]-based test with xunit
#7163
Replies: 1 comment 7 replies
-
|
@sebastienros It is indeed more of xunit question. From what I know, xunit theories can have two modes of running:
There is a For discovery, it looks like this default to "not pre-enumerate": For execution, it only pre-enumerates in Test Explorer: https://github.com/xunit/xunit/blob/45bbafd93f8ae076a8aef4655b585c34daf99b90/src/common/MicrosoftTestingPlatform/TestPlatformTestFramework.cs#L206-L207 cc @bradwilson |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I would understand if it was a question to ask on the xunit repository, but here is my issue:
xunit.v3.mtp-v2@3.2.1(no other test sdk or runner)[Theory]values (inlinedata, classdata)dotnet test --list-testsand see all these "computed" testsdotnet testand see all these tests executedI would assume there should be a way to run one from the output of the --list-tests but can't find any example for this. I tried the
--filter-uidbut have no idea what to use here.Or is it missing something like
--filter-displayname?method, ... are useless unless it can filter on the provided data too.I found some ways around it but they are quite complex as it means listing the full details of a test including its technical id, grep it, and then run with the id. I assume that might be what test hosts are doing but I feel there should be a native command to do it by name.
Beta Was this translation helpful? Give feedback.
All reactions