Skip to content

Commit 266d589

Browse files
committed
Merge branch 'v3'
2 parents 13b929e + c5e1d6c commit 266d589

18 files changed

+764
-1314
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
![Icon](https://github.com/asherber/Xunit.Priority/blob/main/media/xunit-priority-64.png)
22

3-
# Xunit.Priority [![NuGet](https://img.shields.io/nuget/v/Xunit.Priority.svg)](https://nuget.org/packages/Xunit.Priority) [![Build status](https://github.com/asherber/Xunit.Priority/actions/workflows/CI.yml/badge.svg)](https://github.com/asherber/Xunit.Priority/actions)
3+
# Xunit.Priority [![Build status](https://github.com/asherber/Xunit.Priority/actions/workflows/CI.yml/badge.svg)](https://github.com/asherber/Xunit.Priority/actions)
4+
5+
| Package | Supported xUnit Version | NuGet |
6+
|------------------------|------------------------|----------------------------------------------------------------------------------------|
7+
| Xunit.Priority | xunit v2 | [![NuGet](https://img.shields.io/nuget/v/Xunit.Priority.svg)](https://nuget.org/packages/Xunit.Priority) |
8+
| Xunit.v3.Priority | xunit v3 | [![NuGet](https://img.shields.io/nuget/v/Xunit.v3.Priority.svg)](https://nuget.org/packages/Xunit.v3.Priority) |
49

510
Provides an `ITestCaseOrderer` that allows you to control the order of execution of Xunit tests within a class.
611

@@ -13,7 +18,11 @@ Based closely on the code at https://github.com/xunit/samples.xunit/tree/main/Te
1318
Add the following attribute to classes for which you want tests run in order:
1419

1520
```csharp
21+
// for Xunit.Priority
1622
[TestCaseOrderer(PriorityOrderer.Name, PriorityOrderer.Assembly)]
23+
24+
// for Xunit.v3.Priority
25+
[TestCaseOrderer(typeof(PriorityOrderer))]
1726
```
1827

1928
Then decorate your test methods with the `Priority` attribute.

Xunit.Priority.Tests/BasicPriorityTests.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@
44
using System.Text;
55
using System.Threading.Tasks;
66
using Xunit;
7-
using Xunit.Priority;
87
using FluentAssertions;
98

9+
#if V3
10+
using Xunit.v3.Priority;
11+
12+
namespace Xunit.v3.Priority.Tests
13+
#else
14+
using Xunit.Priority;
15+
1016
namespace Xunit.Priority.Tests
17+
#endif
1118
{
1219
public class BasicPriorityTests: TestsBase
1320
{

Xunit.Priority.Tests/NoPriorityTests.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@
44
using System.Text;
55
using System.Threading.Tasks;
66
using Xunit;
7-
using Xunit.Priority;
87
using FluentAssertions;
98

9+
#if V3
10+
using Xunit.v3.Priority;
11+
12+
namespace Xunit.v3.Priority.Tests
13+
#else
14+
using Xunit.Priority;
15+
1016
namespace Xunit.Priority.Tests
17+
#endif
1118
{
1219
public class NoPriorityTests: TestsBase
1320
{

Xunit.Priority.Tests/OnePriorityMinDefaultTests.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@
44
using System.Text;
55
using System.Threading.Tasks;
66
using Xunit;
7-
using Xunit.Priority;
87
using FluentAssertions;
98

9+
#if V3
10+
using Xunit.v3.Priority;
11+
12+
namespace Xunit.v3.Priority.Tests
13+
#else
14+
using Xunit.Priority;
15+
1016
namespace Xunit.Priority.Tests
17+
#endif
1118
{
1219
[DefaultPriority(int.MinValue)]
1320
public class OnePriorityMinDefaultTests: TestsBase

Xunit.Priority.Tests/PriorityWithMaxDefaultTests.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@
44
using System.Text;
55
using System.Threading.Tasks;
66
using Xunit;
7-
using Xunit.Priority;
87
using FluentAssertions;
98

9+
#if V3
10+
using Xunit.v3.Priority;
11+
12+
namespace Xunit.v3.Priority.Tests
13+
#else
14+
using Xunit.Priority;
15+
1016
namespace Xunit.Priority.Tests
17+
#endif
1118
{
1219
[DefaultPriority(int.MaxValue)]
1320
public class PriorityWithMaxDefaultTests: TestsBase

Xunit.Priority.Tests/PriorityWithZeroDefault.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@
44
using System.Text;
55
using System.Threading.Tasks;
66
using Xunit;
7-
using Xunit.Priority;
87
using FluentAssertions;
98

9+
#if V3
10+
using Xunit.v3.Priority;
11+
12+
namespace Xunit.v3.Priority.Tests
13+
#else
14+
using Xunit.Priority;
15+
1016
namespace Xunit.Priority.Tests
17+
#endif
1118
{
1219
[DefaultPriority(0)]
1320
public class PriorityWithZeroDefault: TestsBase

Xunit.Priority.Tests/TestsBase.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,17 @@
66
using System.Threading.Tasks;
77
using FluentAssertions;
88

9+
#if V3
10+
namespace Xunit.v3.Priority.Tests
11+
#else
912
namespace Xunit.Priority.Tests
13+
#endif
1014
{
15+
#if V3
16+
[TestCaseOrderer(typeof(PriorityOrderer))]
17+
#else
1118
[TestCaseOrderer(PriorityOrderer.Name, PriorityOrderer.Assembly)]
19+
#endif
1220
public abstract class TestsBase
1321
{
1422
private FieldInfo _counterField;

Xunit.Priority.Tests/Xunit.Priority.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
1111
<PackageReference Include="xunit" Version="2.9.0" />
12-
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
12+
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.1" />
1313
<PackageReference Include="FluentAssertions" Version="5.8.0" />
1414
</ItemGroup>
1515

0 commit comments

Comments
 (0)