11// Licensed to the .NET Foundation under one or more agreements.
22// The .NET Foundation licenses this file to you under the MIT license.
33
4+ using System . Threading . Tasks ;
45using Microsoft . DotNet . RemoteExecutor ;
56using Xunit ;
67
@@ -13,7 +14,7 @@ public class RuntimeSettingParserTest
1314 [ ConditionalTheory ( nameof ( SupportsRemoteExecutor ) ) ]
1415 [ InlineData ( false ) ]
1516 [ InlineData ( true ) ]
16- public void QueryRuntimeSettingSwitch_WhenNotSet_DefaultIsUsed ( bool defaultValue )
17+ public async Task QueryRuntimeSettingSwitch_WhenNotSet_DefaultIsUsed ( bool defaultValue )
1718 {
1819 static void RunTest ( string defaultValueStr )
1920 {
@@ -22,11 +23,11 @@ static void RunTest(string defaultValueStr)
2223 Assert . Equal ( expected , actual ) ;
2324 }
2425
25- RemoteExecutor . Invoke ( RunTest , defaultValue . ToString ( ) ) . Dispose ( ) ;
26+ await RemoteExecutor . Invoke ( RunTest , defaultValue . ToString ( ) ) . DisposeAsync ( ) ;
2627 }
2728
2829 [ ConditionalFact ( nameof ( SupportsRemoteExecutor ) ) ]
29- public void QueryRuntimeSettingSwitch_AppContextHasPriority ( )
30+ public async Task QueryRuntimeSettingSwitch_AppContextHasPriority ( )
3031 {
3132 static void RunTest ( )
3233 {
@@ -37,11 +38,11 @@ static void RunTest()
3738 RemoteInvokeOptions options = new RemoteInvokeOptions ( ) ;
3839 options . StartInfo . EnvironmentVariables [ "FOO_BAR" ] = "true" ;
3940
40- RemoteExecutor . Invoke ( RunTest , options ) . Dispose ( ) ;
41+ await RemoteExecutor . Invoke ( RunTest , options ) . DisposeAsync ( ) ;
4142 }
4243
4344 [ ConditionalFact ( nameof ( SupportsRemoteExecutor ) ) ]
44- public void QueryRuntimeSettingSwitch_EnvironmentVariable ( )
45+ public async Task QueryRuntimeSettingSwitch_EnvironmentVariable ( )
4546 {
4647 static void RunTest ( )
4748 {
@@ -51,11 +52,11 @@ static void RunTest()
5152 RemoteInvokeOptions options = new RemoteInvokeOptions ( ) ;
5253 options . StartInfo . EnvironmentVariables [ "FOO_BAR" ] = "false" ;
5354
54- RemoteExecutor . Invoke ( RunTest , options ) . Dispose ( ) ;
55+ await RemoteExecutor . Invoke ( RunTest , options ) . DisposeAsync ( ) ;
5556 }
5657
5758 [ ConditionalFact ( nameof ( SupportsRemoteExecutor ) ) ]
58- public void QueryRuntimeSettingSwitch_InvalidValue_FallbackToDefault ( )
59+ public async Task QueryRuntimeSettingSwitch_InvalidValue_FallbackToDefault ( )
5960 {
6061 static void RunTest ( )
6162 {
@@ -65,13 +66,13 @@ static void RunTest()
6566 RemoteInvokeOptions options = new RemoteInvokeOptions ( ) ;
6667 options . StartInfo . EnvironmentVariables [ "FOO_BAR" ] = "cheese" ;
6768
68- RemoteExecutor . Invoke ( RunTest , options ) . Dispose ( ) ;
69+ await RemoteExecutor . Invoke ( RunTest , options ) . DisposeAsync ( ) ;
6970 }
7071
7172 [ ConditionalTheory ( nameof ( SupportsRemoteExecutor ) ) ]
7273 [ InlineData ( 0 ) ]
7374 [ InlineData ( 42 ) ]
74- public void QueryRuntimeSettingInt32_WhenNotSet_DefaultIsUsed ( int defaultValue )
75+ public async Task QueryRuntimeSettingInt32_WhenNotSet_DefaultIsUsed ( int defaultValue )
7576 {
7677 static void RunTest ( string defaultValueStr )
7778 {
@@ -80,11 +81,11 @@ static void RunTest(string defaultValueStr)
8081 Assert . Equal ( expected , actual ) ;
8182 }
8283
83- RemoteExecutor . Invoke ( RunTest , defaultValue . ToString ( ) ) . Dispose ( ) ;
84+ await RemoteExecutor . Invoke ( RunTest , defaultValue . ToString ( ) ) . DisposeAsync ( ) ;
8485 }
8586
8687 [ ConditionalFact ( nameof ( SupportsRemoteExecutor ) ) ]
87- public void QueryRuntimeSettingInt32_AppContextHasPriority ( )
88+ public async Task QueryRuntimeSettingInt32_AppContextHasPriority ( )
8889 {
8990 static void RunTest ( )
9091 {
@@ -95,11 +96,11 @@ static void RunTest()
9596 RemoteInvokeOptions options = new RemoteInvokeOptions ( ) ;
9697 options . StartInfo . EnvironmentVariables [ "FOO_BAR" ] = "3" ;
9798
98- RemoteExecutor . Invoke ( RunTest , options ) . Dispose ( ) ;
99+ await RemoteExecutor . Invoke ( RunTest , options ) . DisposeAsync ( ) ;
99100 }
100101
101102 [ ConditionalFact ( nameof ( SupportsRemoteExecutor ) ) ]
102- public void QueryRuntimeSettingInt32_EnvironmentVariable ( )
103+ public async Task QueryRuntimeSettingInt32_EnvironmentVariable ( )
103104 {
104105 static void RunTest ( )
105106 {
@@ -109,12 +110,12 @@ static void RunTest()
109110 RemoteInvokeOptions options = new RemoteInvokeOptions ( ) ;
110111 options . StartInfo . EnvironmentVariables [ "FOO_BAR" ] = "1" ;
111112
112- RemoteExecutor . Invoke ( RunTest , options ) . Dispose ( ) ;
113+ await RemoteExecutor . Invoke ( RunTest , options ) . DisposeAsync ( ) ;
113114 }
114115
115116
116117 [ ConditionalFact ( nameof ( SupportsRemoteExecutor ) ) ]
117- public void QueryRuntimeSettingInt32_InvalidValue_FallbackToDefault ( )
118+ public async Task QueryRuntimeSettingInt32_InvalidValue_FallbackToDefault ( )
118119 {
119120 static void RunTest ( )
120121 {
@@ -124,22 +125,22 @@ static void RunTest()
124125 RemoteInvokeOptions options = new RemoteInvokeOptions ( ) ;
125126 options . StartInfo . EnvironmentVariables [ "FOO_BAR" ] = "cheese" ;
126127
127- RemoteExecutor . Invoke ( RunTest , options ) . Dispose ( ) ;
128+ await RemoteExecutor . Invoke ( RunTest , options ) . DisposeAsync ( ) ;
128129 }
129130
130131 [ ConditionalFact ( nameof ( SupportsRemoteExecutor ) ) ]
131- public void ParseInt32EnvironmentVariableValue_WhenNotSet_DefaultIsUsed ( )
132+ public async Task ParseInt32EnvironmentVariableValue_WhenNotSet_DefaultIsUsed ( )
132133 {
133134 static void RunTest ( )
134135 {
135136 int actual = RuntimeSettingParser . ParseInt32EnvironmentVariableValue ( "FOO_BAR" , - 42 ) ;
136137 Assert . Equal ( - 42 , actual ) ;
137138 }
138- RemoteExecutor . Invoke ( RunTest ) . Dispose ( ) ;
139+ await RemoteExecutor . Invoke ( RunTest ) . DisposeAsync ( ) ;
139140 }
140141
141142 [ ConditionalFact ( nameof ( SupportsRemoteExecutor ) ) ]
142- public void ParseInt32EnvironmentVariableValue_ValidValue ( )
143+ public async Task ParseInt32EnvironmentVariableValue_ValidValue ( )
143144 {
144145 static void RunTest ( )
145146 {
@@ -150,11 +151,11 @@ static void RunTest()
150151 RemoteInvokeOptions options = new RemoteInvokeOptions ( ) ;
151152 options . StartInfo . EnvironmentVariables [ "FOO_BAR" ] = "84" ;
152153
153- RemoteExecutor . Invoke ( RunTest , options ) . Dispose ( ) ;
154+ await RemoteExecutor . Invoke ( RunTest , options ) . DisposeAsync ( ) ;
154155 }
155156
156157 [ ConditionalFact ( nameof ( SupportsRemoteExecutor ) ) ]
157- public void ParseInt32EnvironmentVariableValue_InvalidValue_FallbackToDefault ( )
158+ public async Task ParseInt32EnvironmentVariableValue_InvalidValue_FallbackToDefault ( )
158159 {
159160 static void RunTest ( )
160161 {
@@ -165,22 +166,22 @@ static void RunTest()
165166 RemoteInvokeOptions options = new RemoteInvokeOptions ( ) ;
166167 options . StartInfo . EnvironmentVariables [ "FOO_BAR" ] = "-~4!" ;
167168
168- RemoteExecutor . Invoke ( RunTest , options ) . Dispose ( ) ;
169+ await RemoteExecutor . Invoke ( RunTest , options ) . DisposeAsync ( ) ;
169170 }
170171
171172 [ ConditionalFact ( nameof ( SupportsRemoteExecutor ) ) ]
172- public void ParseDoubleEnvironmentVariableValue_WhenNotSet_DefaultIsUsed ( )
173+ public async Task ParseDoubleEnvironmentVariableValue_WhenNotSet_DefaultIsUsed ( )
173174 {
174175 static void RunTest ( )
175176 {
176177 double actual = RuntimeSettingParser . ParseDoubleEnvironmentVariableValue ( "FOO_BAR" , - 0.42 ) ;
177178 Assert . Equal ( - 0.42 , actual ) ;
178179 }
179- RemoteExecutor . Invoke ( RunTest ) . Dispose ( ) ;
180+ await RemoteExecutor . Invoke ( RunTest ) . DisposeAsync ( ) ;
180181 }
181182
182183 [ ConditionalFact ( nameof ( SupportsRemoteExecutor ) ) ]
183- public void ParseDoubleEnvironmentVariableValue_ValidValue ( )
184+ public async Task ParseDoubleEnvironmentVariableValue_ValidValue ( )
184185 {
185186 static void RunTest ( )
186187 {
@@ -191,11 +192,11 @@ static void RunTest()
191192 RemoteInvokeOptions options = new RemoteInvokeOptions ( ) ;
192193 options . StartInfo . EnvironmentVariables [ "FOO_BAR" ] = "0.84" ;
193194
194- RemoteExecutor . Invoke ( RunTest , options ) . Dispose ( ) ;
195+ await RemoteExecutor . Invoke ( RunTest , options ) . DisposeAsync ( ) ;
195196 }
196197
197198 [ ConditionalFact ( nameof ( SupportsRemoteExecutor ) ) ]
198- public void ParseDoubleEnvironmentVariableValue_InvalidValue_FallbackToDefault ( )
199+ public async Task ParseDoubleEnvironmentVariableValue_InvalidValue_FallbackToDefault ( )
199200 {
200201 static void RunTest ( )
201202 {
@@ -206,7 +207,7 @@ static void RunTest()
206207 RemoteInvokeOptions options = new RemoteInvokeOptions ( ) ;
207208 options . StartInfo . EnvironmentVariables [ "FOO_BAR" ] = "-~4!" ;
208209
209- RemoteExecutor . Invoke ( RunTest , options ) . Dispose ( ) ;
210+ await RemoteExecutor . Invoke ( RunTest , options ) . DisposeAsync ( ) ;
210211 }
211212 }
212213}
0 commit comments