asherber / Xunit.Priority

Provides an ITestCaseOrderer that allows you to control the order of execution of Xunit tests within a class.
Apache License 2.0
49 stars 2 forks source link

maybe the default test priority could be 0 instead of maxint #9

Closed zidad closed 4 weeks ago

zidad commented 6 months ago

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?

asherber commented 6 months ago

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.