Skip to content

Instantly share code, notes, and snippets.

@ErikSchierboom
Created December 4, 2019 15:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ErikSchierboom/b99f41fbc50172624d469b279c6cbe11 to your computer and use it in GitHub Desktop.
Save ErikSchierboom/b99f41fbc50172624d469b279c6cbe11 to your computer and use it in GitHub Desktop.
Force execution in order
public class TestCaseInDiscoveryOrderOrderer : ITestCaseOrderer
{
public IEnumerable<TTestCase> OrderTestCases<TTestCase>(IEnumerable<TTestCase> testCases) where TTestCase : ITestCase =>
testCases.ToList();
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Csharp1A.Example.Functional.cs" />
<Compile Remove="Csharp1A.Example.Imperative.cs" />
<Compile Remove="Csharp1A.Example.Regex.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
</ItemGroup>
<ItemGroup>
<AssemblyAttribute Include="Xunit.TestCaseOrderer">
<_Parameter1>TestCaseInDiscoveryOrderOrderer</_Parameter1>
<_Parameter2>Csharp1A</_Parameter2>
</AssemblyAttribute>
</ItemGroup>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment