How to set priority for InlineData() from Xunit Theory test

20 views Asked by At

I have following test

[Theory(DisplayName = nameof(GenerativeAnswersResponseAsync))]
[InlineData("GenerativeAnswers1", GenerativeAnswers_InDomainTest, false, true)]
[InlineData("GenerativeAnswers2", GenerativeAnswers_OutDomainTest, false, true)]

How can I set priority so that "GenerativeAnswers1" is executed first?

1

There are 1 answers

2
Ruben Bartelink On

Attributes such as InlineData on a method don't have a guaranteed relative order, so they'll arrive from the reflection APIs in the order the compiler fed them into the assembly.

If you want to control the order, you'll have to do that via MemberData, ClassData or TheoryData