Skip to content

Commit a820cbe

Browse files
committed
Update SampleLibrary project.
1 parent dfd2ee6 commit a820cbe

8 files changed

Lines changed: 46 additions & 28 deletions

File tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
namespace SampleLibrary;
22

3-
public class One
3+
public class A
44
{
5-
public async Task<int> FuncOne()
5+
public async Task<int> CallA()
66
{
77
System.Diagnostics.Debug.WriteLine("FuncOne started");
88

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
namespace SampleLibrary;
22

3-
public class Two
3+
public class B
44
{
5-
public async Task<int> FuncTwo()
5+
public async Task<int> CallB()
66
{
77
System.Diagnostics.Debug.WriteLine("FuncTwo started");
88

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
namespace SampleLibrary;
22

3-
public class Three
3+
public class C
44
{
5-
public async Task<int> FuncThree(int inputOne, int inputTwo)
5+
public async Task<int> CallC(int inputOne, int inputTwo)
66
{
77
System.Diagnostics.Debug.WriteLine("FuncThree started");
88

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
namespace SampleLibrary;
22

3-
public class Four
3+
public class D
44
{
5-
public async Task<int> FuncFour()
5+
public async Task<int> CallD()
66
{
77
System.Diagnostics.Debug.WriteLine("FuncFour started");
88

SampleLibrary/E.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace SampleLibrary;
2+
3+
public class E
4+
{
5+
public async Task<int> CallE(int input)
6+
{
7+
System.Diagnostics.Debug.WriteLine("FuncFour started");
8+
9+
await Task.Delay(1000);
10+
11+
System.Diagnostics.Debug.WriteLine("FuncFour ended");
12+
13+
return await Task.FromResult(5 + input);
14+
}
15+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
namespace SampleLibrary;
22

3-
public class Final
3+
public class F
44
{
5-
public async Task<int> FuncFinal(int inputOne, int inputTwo)
5+
public async Task<int> CallF(int inputOne, int inputTwo)
66
{
77
System.Diagnostics.Debug.WriteLine("FuncFinal started");
88
return await Task.FromResult(inputOne + inputTwo);

SampleLibrary/Main.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
public class Main
44
{
55
public async Task<int> ExecuteAsync() {
6-
var orchestrator = new Orchestrator(new One(), new Two(), new Three(), new Four(), new Final());
6+
var orchestrator = new Orchestrator(new A(), new B(), new C(), new D(), new E(), new F());
77

88
var result = await orchestrator.Execute();
99

SampleLibrary/OrchestratorSpec.cs

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,32 @@
33
namespace SampleLibrary;
44

55
[AsyncTaskOrchestrator]
6-
public class OrchestratorSpec
6+
internal class OrchestratorSpec
77
{
8-
private readonly One one;
9-
private readonly Two two;
10-
private readonly Three three;
11-
private readonly Four four;
12-
private readonly Final final;
8+
private readonly A a;
9+
private readonly B b;
10+
private readonly C c;
11+
private readonly D d;
12+
private readonly E e;
13+
private readonly F f;
1314

14-
public OrchestratorSpec(One one, Two two, Three three, Four four, Final final)
15+
public OrchestratorSpec(A a, B b, C c, D d, E e, F f)
1516
{
16-
this.one = one;
17-
this.two = two;
18-
this.three = three;
19-
this.four = four;
20-
this.final = final;
17+
this.a = a;
18+
this.b = b;
19+
this.c = c;
20+
this.d = d;
21+
this.e = e;
22+
this.f = f;
2123
}
2224

2325
public Task<int> Spec()
2426
{
25-
var resultOne = one.FuncOne();
26-
var resultTwo = two.FuncTwo();
27-
var resultThree = three.FuncThree(resultOne.Result, resultTwo.Result);
28-
var resultFour = four.FuncFour();
29-
return final.FuncFinal(resultThree.Result, resultFour.Result);
27+
var resultA = a.CallA();
28+
var resultB = b.CallB();
29+
var resultC = c.CallC(resultA.Result, resultB.Result);
30+
var resultD = d.CallD();
31+
var resultE = e.CallE(resultD.Result);
32+
return f.CallF(resultC.Result, resultE.Result);
3033
}
3134
}

0 commit comments

Comments
 (0)