增加DefaultOrderer,默认排序(按方法在类内出现的顺序)
大石头 authored at 2022-03-19 21:00:35
663.00 B
NewLife.UnitTest
using System.Threading;
using NewLife.UnitTest;
using Xunit;

namespace XUnitTest
{
    [TestCaseOrderer("NewLife.UnitTest.PriorityOrderer", "NewLife.UnitTest")]
    public class OrderTests
    {
        [TestOrder(1)]
        [Fact]
        public void Test3() => Thread.Sleep(1000);

        [TestOrder(2)]
        [Fact]
        public void Test2() => Thread.Sleep(1000);

        [TestOrder(3)]
        [Fact]
        public void Test1() => Thread.Sleep(1000);

        [TestOrder(4)]
        [Fact]
        public void Test4() => Thread.Sleep(1000);
        
        [TestOrder(5)]
        [Fact]
        public void Test5() => Thread.Sleep(1000);
    }
}