XUnit some important test attribute and filters
Setting unit test priority using Trait Attribute.
If you ever needed your unit test to run first before other being run, then you can change the order of execution using [Trait] as shown in diagram below. The higher the value, the higher the priority.
I tried this, doesn't seems to work.
[] // Run last
[] // Definitely run this first
Common filter used are :-
DisplayName=MyUnitNamespace.UnitClass.UnitTest1 - Match by exact test name with equal operator
DisplayName~UnitTest - Matches any unit test that contains the text 'UnitTest' - with ~ operator
DisplayName!=IntegrationTest - Run all the test except those with 'IntegrationTest' != operator
Comments