Skip to content

Commit 5912b99

Browse files
committed
Fixed an issue related to running example tests in order by fixing the attribute
README.md file was updated accordingly
1 parent bda5deb commit 5912b99

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ The library has a bonus feature that simplifies running tests in order. The test
4949
Decorate your Xunit test class with the following attribute and associate ```TestOrder(...)``` with ```Fact```and ```Theory```:
5050

5151
```csharp
52-
[TestCaseOrderer("Xunit.Microsoft.DependencyInjection.TestsOrder.TestPriorityOrderer", "Xunit.Microsoft.DependencyInjection.TestsOrder")]
52+
[TestCaseOrderer("Xunit.Microsoft.DependencyInjection.TestsOrder.TestPriorityOrderer", "Xunit.Microsoft.DependencyInjection")]
5353
```
5454

5555
## Examples

examples/Xunit.Microsoft.DependencyInjection.ExampleTests/UnitTests.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
using System.Threading.Tasks;
12
using Xunit.Microsoft.DependencyInjection.Attributes;
23

34
namespace Xunit.Microsoft.DependencyInjection.ExampleTests
45
{
5-
[TestCaseOrderer("Xunit.Microsoft.DependencyInjection.TestsOrder.TestPriorityOrderer", "Xunit.Microsoft.DependencyInjection.TestsOrder")]
6+
[TestCaseOrderer("Xunit.Microsoft.DependencyInjection.TestsOrder.TestPriorityOrderer", "Xunit.Microsoft.DependencyInjection")]
67
public class UnitTests
78
{
89
[Fact, TestOrder(1)]
@@ -12,5 +13,19 @@ public void Test1()
1213
[Fact, TestOrder(2)]
1314
public void Test2()
1415
=> Assert.False(1 == 0);
16+
17+
[Fact, TestOrder(3)]
18+
public async Task Test3()
19+
{
20+
await Task.Delay(3000);
21+
Assert.True(1 == 1);
22+
}
23+
24+
[Fact, TestOrder(4)]
25+
public async Task Test4()
26+
{
27+
await Task.Delay(5000);
28+
Assert.True(1 > 0);
29+
}
1530
}
1631
}

0 commit comments

Comments
 (0)