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

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

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

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

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