can you tell me if it is possible to somehow skip test execution depending on the value of a Boolean variable in the json file, the skip attribute is not tied to the condition, and reflection does not see this attribute, just if-return does not suitable.
I need the test not to even run, so it doesn’t suit me if it simply returns successful execution (without executing the body)
Skip attribute, If-Return in body of test Reflection
Skip tests depending on the value of a boolean variable but it doesn't work
As far as I know xUnit does not provide built-in solution for this currently. But there are 3rd party libraries like
Xunit.SkippableFactwhich allows you to skip certain tests during runtime if some conditions met.SkippableTheoryis also supported if you are using parameterized unit tests (PUT).UPDATE #1
In case of xUnit V3, which is not released at the time of writing, will support dynamic skipability.
UPDATE #2
It does work for me.