File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
examples/Xunit.Microsoft.DependencyInjection.ExampleTests Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ The library has a bonus feature that simplifies running tests in order. The test
4949Decorate 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
Original file line number Diff line number Diff line change 1+ using System . Threading . Tasks ;
12using Xunit . Microsoft . DependencyInjection . Attributes ;
23
34namespace 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}
You can’t perform that action at this time.
0 commit comments