File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,16 +4,8 @@ public class A
44{
55 public async Task < int > CallA ( )
66 {
7- System . Diagnostics . Debug . WriteLine ( "FuncOne started" ) ;
8-
9- await Task . Delay ( 1000 ) ;
10-
11- System . Diagnostics . Debug . WriteLine ( "FuncOne ended" ) ;
7+ await Utils . DebugDelay ( nameof ( CallA ) , 1000 ) ;
128
139 return await Task . FromResult ( 1 ) ;
1410 }
15-
16- public int Blah ( ) {
17- return 5 ;
18- }
1911}
Original file line number Diff line number Diff line change @@ -4,11 +4,7 @@ public class B
44{
55 public async Task < int > CallB ( )
66 {
7- System . Diagnostics . Debug . WriteLine ( "FuncTwo started" ) ;
8-
9- await Task . Delay ( 1200 ) ;
10-
11- System . Diagnostics . Debug . WriteLine ( "FuncTwo ended" ) ;
7+ await Utils . DebugDelay ( nameof ( CallB ) , 1200 ) ;
128
139 return await Task . FromResult ( 2 ) ;
1410 }
Original file line number Diff line number Diff line change @@ -4,11 +4,7 @@ public class C
44{
55 public async Task < int > CallC ( int inputOne , int inputTwo )
66 {
7- System . Diagnostics . Debug . WriteLine ( "FuncThree started" ) ;
8-
9- await Task . Delay ( 1000 ) ;
10-
11- System . Diagnostics . Debug . WriteLine ( "FuncThree ended" ) ;
7+ await Utils . DebugDelay ( nameof ( CallC ) , 1000 ) ;
128
139 return await Task . FromResult ( inputOne + inputTwo ) ;
1410 }
Original file line number Diff line number Diff line change @@ -4,11 +4,7 @@ public class D
44{
55 public async Task < int > CallD ( )
66 {
7- System . Diagnostics . Debug . WriteLine ( "FuncFour started" ) ;
8-
9- await Task . Delay ( 4000 ) ;
10-
11- System . Diagnostics . Debug . WriteLine ( "FuncFour ended" ) ;
7+ await Utils . DebugDelay ( nameof ( CallD ) , 4000 ) ;
128
139 return await Task . FromResult ( 4 ) ;
1410 }
Original file line number Diff line number Diff line change @@ -4,11 +4,7 @@ public class E
44{
55 public async Task < int > CallE ( int input )
66 {
7- System . Diagnostics . Debug . WriteLine ( "FuncFour started" ) ;
8-
9- await Task . Delay ( 1000 ) ;
10-
11- System . Diagnostics . Debug . WriteLine ( "FuncFour ended" ) ;
7+ await Utils . DebugDelay ( nameof ( CallE ) , 1000 ) ;
128
139 return await Task . FromResult ( 5 + input ) ;
1410 }
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ public class F
44{
55 public async Task < int > CallF ( int inputOne , int inputTwo )
66 {
7- System . Diagnostics . Debug . WriteLine ( "FuncFinal started" ) ;
7+ await Utils . DebugDelay ( nameof ( CallF ) , 0 ) ;
88 return await Task . FromResult ( inputOne + inputTwo ) ;
99 }
1010}
Original file line number Diff line number Diff line change 33namespace SampleLibrary ;
44
55[ AsyncTaskOrchestrator ]
6- internal class OrchestratorSpec
6+ public class OrchestratorSpec
77{
88 private readonly A a ;
99 private readonly B b ;
Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk" >
22
33 <PropertyGroup >
4- <TargetFramework >net10 .0</TargetFramework >
4+ <TargetFramework >net9 .0</TargetFramework >
55 <ImplicitUsings >enable</ImplicitUsings >
66 <Nullable >enable</Nullable >
77 </PropertyGroup >
Original file line number Diff line number Diff line change 1+ namespace SampleLibrary ;
2+
3+ internal class Utils
4+ {
5+ public static async Task DebugDelay ( string functionName , int delayTime )
6+ {
7+ System . Diagnostics . Debug . WriteLine ( $ "{ functionName } started") ;
8+
9+ await Task . Delay ( delayTime ) ;
10+
11+ System . Diagnostics . Debug . WriteLine ( $ "{ functionName } ended") ;
12+ }
13+ }
You can’t perform that action at this time.
0 commit comments