@@ -26,41 +26,41 @@ private static async Task MainAsync(string[] args)
26
26
. UseTcp ( IPAddress . Loopback , 45684 )
27
27
. Build ( ) ;
28
28
29
- //// test 1: call IPC service method with primitive types
30
- // float result1 = await computingClient.InvokeAsync(x => x.AddFloat(1.23f, 4.56f));
31
- // Console.WriteLine($"[TEST 1] sum of 2 floating number is: {result1}");
29
+ // test 1: call IPC service method with primitive types
30
+ float result1 = await computingClient . InvokeAsync ( x => x . AddFloat ( 1.23f , 4.56f ) ) ;
31
+ Console . WriteLine ( $ "[TEST 1] sum of 2 floating number is: { result1 } ") ;
32
32
33
- //// test 2: call IPC service method with complex types
34
- // ComplexNumber result2 = await computingClient.InvokeAsync(x => x.AddComplexNumber(
35
- // new ComplexNumber(0.1f, 0.3f),
36
- // new ComplexNumber(0.2f, 0.6f)));
37
- // Console.WriteLine($"[TEST 2] sum of 2 complexe number is: {result2.A}+{result2.B}i");
33
+ // test 2: call IPC service method with complex types
34
+ ComplexNumber result2 = await computingClient . InvokeAsync ( x => x . AddComplexNumber (
35
+ new ComplexNumber ( 0.1f , 0.3f ) ,
36
+ new ComplexNumber ( 0.2f , 0.6f ) ) ) ;
37
+ Console . WriteLine ( $ "[TEST 2] sum of 2 complexe number is: { result2 . A } +{ result2 . B } i") ;
38
38
39
- //// test 3: call IPC service method with an array of complex types
40
- // ComplexNumber result3 = await computingClient.InvokeAsync(x => x.AddComplexNumbers(new[]
41
- // {
42
- // new ComplexNumber(0.5f, 0.4f),
43
- // new ComplexNumber(0.2f, 0.1f),
44
- // new ComplexNumber(0.3f, 0.5f),
45
- // }));
46
- // Console.WriteLine($"[TEST 3] sum of 3 complexe number is: {result3.A}+{result3.B}i");
39
+ // test 3: call IPC service method with an array of complex types
40
+ ComplexNumber result3 = await computingClient . InvokeAsync ( x => x . AddComplexNumbers ( new [ ]
41
+ {
42
+ new ComplexNumber ( 0.5f , 0.4f ) ,
43
+ new ComplexNumber ( 0.2f , 0.1f ) ,
44
+ new ComplexNumber ( 0.3f , 0.5f ) ,
45
+ } ) ) ;
46
+ Console . WriteLine ( $ "[TEST 3] sum of 3 complexe number is: { result3 . A } +{ result3 . B } i") ;
47
47
48
- //// test 4: call IPC service method without parameter or return
49
- // await systemClient.InvokeAsync(x => x.DoNothing());
50
- // Console.WriteLine($"[TEST 4] invoked DoNothing()");
48
+ // test 4: call IPC service method without parameter or return
49
+ await systemClient . InvokeAsync ( x => x . DoNothing ( ) ) ;
50
+ Console . WriteLine ( $ "[TEST 4] invoked DoNothing()") ;
51
51
52
- //// test 5: call IPC service method with enum parameter
53
- // string text = await systemClient.InvokeAsync(x => x.ConvertText("hEllO woRd!", TextStyle.Upper));
54
- // Console.WriteLine($"[TEST 5] {text}");
52
+ // test 5: call IPC service method with enum parameter
53
+ string text = await systemClient . InvokeAsync ( x => x . ConvertText ( "hEllO woRd!" , TextStyle . Upper ) ) ;
54
+ Console . WriteLine ( $ "[TEST 5] { text } ") ;
55
55
56
- //// test 6: call IPC service method returning GUID
57
- // Guid generatedId = await systemClient.InvokeAsync(x => x.GenerateId());
58
- // Console.WriteLine($"[TEST 6] generated ID is: {generatedId}");
56
+ // test 6: call IPC service method returning GUID
57
+ Guid generatedId = await systemClient . InvokeAsync ( x => x . GenerateId ( ) ) ;
58
+ Console . WriteLine ( $ "[TEST 6] generated ID is: { generatedId } ") ;
59
59
60
- //// test 7: call IPC service method with byte array
61
- // byte[] input = Encoding.UTF8.GetBytes("Test");
62
- // byte[] reversed = await systemClient.InvokeAsync(x => x.ReverseBytes(input));
63
- // Console.WriteLine($"[TEST 7] reversed bytes are: {Convert.ToBase64String(reversed)}");
60
+ // test 7: call IPC service method with byte array
61
+ byte [ ] input = Encoding . UTF8 . GetBytes ( "Test" ) ;
62
+ byte [ ] reversed = await systemClient . InvokeAsync ( x => x . ReverseBytes ( input ) ) ;
63
+ Console . WriteLine ( $ "[TEST 7] reversed bytes are: { Convert . ToBase64String ( reversed ) } ") ;
64
64
65
65
// test 8: call IPC service method with generic parameter
66
66
string print = await systemClient . InvokeAsync ( x => x . Printout ( DateTime . UtcNow ) ) ;
0 commit comments