Xunit.Priority icon indicating copy to clipboard operation
Xunit.Priority copied to clipboard

maybe the default test priority could be 0 instead of maxint

Open zidad opened this issue 1 year ago • 1 comments

Thanks a lot for your library!

I have a single test with some assertions I want to run after all other tests are finished, but I think the only way to do that now is to apply the DefaultPriority to all test classes.

If the default priority was always 0 I would only have to create a single test with priority 1 for this.

Would that be something you'd accept as change? Or maybe allow the DefaultPriority to be set on assembly level?

zidad avatar Feb 22 '24 09:02 zidad

You can change the default priority per class. Take a look at the second example in the README -- you decorate the class with a [DefaultPriority] attribute, and then add a [Priority] greater than the default to the test you want to run last.

asherber avatar Feb 22 '24 23:02 asherber