@@ -138,9 +138,9 @@ public async Task ShowCommandGeneratesMermaidMarkdownFileWithMermaidDiagramAsync
138138 Output = new ( "sample.md" )
139139 } ;
140140
141- await OpenApiService . ShowOpenApiDocumentAsync ( options , _logger ) ;
141+ await OpenApiService . ShowOpenApiDocumentAsync ( options , _logger , TestContext . Current . CancellationToken ) ;
142142
143- var output = await File . ReadAllTextAsync ( options . Output . FullName ) ;
143+ var output = await File . ReadAllTextAsync ( options . Output . FullName , TestContext . Current . CancellationToken ) ;
144144 Assert . Contains ( "graph LR" , output , StringComparison . Ordinal ) ;
145145 }
146146
@@ -151,52 +151,52 @@ public async Task ShowCommandGeneratesMermaidHtmlFileWithMermaidDiagramAsync()
151151 {
152152 OpenApi = Path . Combine ( "UtilityFiles" , "SampleOpenApi.yml" )
153153 } ;
154- var filePath = await OpenApiService . ShowOpenApiDocumentAsync ( options , _logger ) ;
154+ var filePath = await OpenApiService . ShowOpenApiDocumentAsync ( options , _logger , TestContext . Current . CancellationToken ) ;
155155 Assert . True ( File . Exists ( filePath ) ) ;
156156 }
157157
158158 [ Fact ]
159159 public Task ThrowIfOpenApiUrlIsNotProvidedWhenValidatingAsync ( )
160160 {
161161 return Assert . ThrowsAsync < ArgumentNullException > ( ( ) =>
162- OpenApiService . ValidateOpenApiDocumentAsync ( "" , _logger ) ) ;
162+ OpenApiService . ValidateOpenApiDocumentAsync ( "" , _logger , TestContext . Current . CancellationToken ) ) ;
163163 }
164164
165165 [ Fact ]
166166 public Task ThrowIfURLIsNotResolvableWhenValidatingAsync ( )
167167 {
168168 return Assert . ThrowsAsync < InvalidOperationException > ( ( ) =>
169- OpenApiService . ValidateOpenApiDocumentAsync ( "https://example.org926F4F21-88E7-4DC5-BF88-6C529BB77844/itdoesnmatter" , _logger ) ) ;
169+ OpenApiService . ValidateOpenApiDocumentAsync ( "https://example.org926F4F21-88E7-4DC5-BF88-6C529BB77844/itdoesnmatter" , _logger , TestContext . Current . CancellationToken ) ) ;
170170 }
171171
172172 [ Fact ]
173173 public Task ThrowIfFileDoesNotExistWhenValidatingAsync ( )
174174 {
175175 return Assert . ThrowsAsync < InvalidOperationException > ( ( ) =>
176- OpenApiService . ValidateOpenApiDocumentAsync ( "aFileThatBetterNotExist.fake" , _logger ) ) ;
176+ OpenApiService . ValidateOpenApiDocumentAsync ( "aFileThatBetterNotExist.fake" , _logger , TestContext . Current . CancellationToken ) ) ;
177177 }
178178
179179 [ Fact ]
180180 public async Task ValidateCommandProcessesOpenApiAsync ( )
181181 {
182182 // create a dummy ILogger instance for testing
183- await OpenApiService . ValidateOpenApiDocumentAsync ( Path . Combine ( "UtilityFiles" , "SampleOpenApi.yml" ) , _logger ) ;
183+ await OpenApiService . ValidateOpenApiDocumentAsync ( Path . Combine ( "UtilityFiles" , "SampleOpenApi.yml" ) , _logger , TestContext . Current . CancellationToken ) ;
184184
185185 Assert . True ( true ) ;
186186 }
187187
188188 [ Fact ]
189189 public async Task ValidFileReturnsTrueAsync ( )
190190 {
191- var isValid = await OpenApiService . ValidateOpenApiDocumentAsync ( Path . Combine ( "UtilityFiles" , "SampleOpenApi.yml" ) , _logger ) ;
191+ var isValid = await OpenApiService . ValidateOpenApiDocumentAsync ( Path . Combine ( "UtilityFiles" , "SampleOpenApi.yml" ) , _logger , TestContext . Current . CancellationToken ) ;
192192
193193 Assert . True ( isValid ) ;
194194 }
195195
196196 [ Fact ]
197197 public async Task InvalidFileReturnsFalseAsync ( )
198198 {
199- var isValid = await OpenApiService . ValidateOpenApiDocumentAsync ( Path . Combine ( "UtilityFiles" , "InvalidSampleOpenApi.yml" ) , _logger ) ;
199+ var isValid = await OpenApiService . ValidateOpenApiDocumentAsync ( Path . Combine ( "UtilityFiles" , "InvalidSampleOpenApi.yml" ) , _logger , TestContext . Current . CancellationToken ) ;
200200
201201 Assert . False ( isValid ) ;
202202 }
@@ -224,9 +224,9 @@ public async Task TransformCommandConvertsOpenApiAsync()
224224 InlineExternal = false ,
225225 } ;
226226 // create a dummy ILogger instance for testing
227- await OpenApiService . TransformOpenApiDocumentAsync ( options , _logger ) ;
227+ await OpenApiService . TransformOpenApiDocumentAsync ( options , _logger , TestContext . Current . CancellationToken ) ;
228228
229- var output = await File . ReadAllTextAsync ( "sample.json" ) ;
229+ var output = await File . ReadAllTextAsync ( "sample.json" , TestContext . Current . CancellationToken ) ;
230230 Assert . NotEmpty ( output ) ;
231231 }
232232
@@ -243,9 +243,9 @@ public async Task TransformCommandConvertsOpenApiWithDefaultOutputNameAsync()
243243 InlineExternal = false ,
244244 } ;
245245 // create a dummy ILogger instance for testing
246- await OpenApiService . TransformOpenApiDocumentAsync ( options , _logger ) ;
246+ await OpenApiService . TransformOpenApiDocumentAsync ( options , _logger , TestContext . Current . CancellationToken ) ;
247247
248- var output = await File . ReadAllTextAsync ( "output.yml" ) ;
248+ var output = await File . ReadAllTextAsync ( "output.yml" , TestContext . Current . CancellationToken ) ;
249249 Assert . NotEmpty ( output ) ;
250250 }
251251
@@ -263,9 +263,9 @@ public async Task TransformCommandConvertsOpenApiWithDefaultOutputNameAndSwitchF
263263 InlineExternal = false ,
264264 } ;
265265 // create a dummy ILogger instance for testing
266- await OpenApiService . TransformOpenApiDocumentAsync ( options , _logger ) ;
266+ await OpenApiService . TransformOpenApiDocumentAsync ( options , _logger , TestContext . Current . CancellationToken ) ;
267267
268- var output = await File . ReadAllTextAsync ( "output.yml" ) ;
268+ var output = await File . ReadAllTextAsync ( "output.yml" , TestContext . Current . CancellationToken ) ;
269269 Assert . NotEmpty ( output ) ;
270270 }
271271
@@ -280,7 +280,7 @@ public Task ThrowTransformCommandIfOpenApiAndCsdlAreEmptyAsync()
280280 InlineExternal = false ,
281281 } ;
282282 return Assert . ThrowsAsync < ArgumentException > ( ( ) =>
283- OpenApiService . TransformOpenApiDocumentAsync ( options , _logger ) ) ;
283+ OpenApiService . TransformOpenApiDocumentAsync ( options , _logger , TestContext . Current . CancellationToken ) ) ;
284284 }
285285
286286 [ Fact ]
@@ -299,9 +299,9 @@ public async Task TransformToPowerShellCompliantOpenApiAsync()
299299 SettingsConfig = SettingsUtilities . GetConfiguration ( settingsPath )
300300 } ;
301301 // create a dummy ILogger instance for testing
302- await OpenApiService . TransformOpenApiDocumentAsync ( options , _logger ) ;
302+ await OpenApiService . TransformOpenApiDocumentAsync ( options , _logger , TestContext . Current . CancellationToken ) ;
303303
304- var output = await File . ReadAllTextAsync ( "output.yaml" ) ;
304+ var output = await File . ReadAllTextAsync ( "output.yaml" , TestContext . Current . CancellationToken ) ;
305305 Assert . NotEmpty ( output ) ;
306306 }
307307
@@ -314,9 +314,9 @@ public async Task InvokeTransformCommandAsync()
314314 var parseResult = rootCommand . Parse ( args ) ;
315315 var handler = Assert . IsType < AsynchronousCommandLineAction > ( rootCommand . Subcommands . First ( c => c . Name == "transform" ) . Action , exactMatch : false ) ;
316316
317- await handler . InvokeAsync ( parseResult ) ;
317+ await handler . InvokeAsync ( parseResult , TestContext . Current . CancellationToken ) ;
318318
319- var output = await File . ReadAllTextAsync ( "sample.json" ) ;
319+ var output = await File . ReadAllTextAsync ( "sample.json" , TestContext . Current . CancellationToken ) ;
320320 Assert . NotEmpty ( output ) ;
321321 }
322322
@@ -330,9 +330,9 @@ public async Task InvokeShowCommandAsync()
330330 var parseResult = rootCommand . Parse ( args ) ;
331331 var handler = Assert . IsType < AsynchronousCommandLineAction > ( rootCommand . Subcommands . First ( c => c . Name == "show" ) . Action , exactMatch : false ) ;
332332
333- await handler . InvokeAsync ( parseResult ) ;
333+ await handler . InvokeAsync ( parseResult , TestContext . Current . CancellationToken ) ;
334334
335- var output = await File . ReadAllTextAsync ( "sample.md" ) ;
335+ var output = await File . ReadAllTextAsync ( "sample.md" , TestContext . Current . CancellationToken ) ;
336336 Assert . Contains ( "graph LR" , output , StringComparison . Ordinal ) ;
337337 }
338338
@@ -345,9 +345,9 @@ public async Task InvokePluginCommandAsync()
345345 var parseResult = rootCommand . Parse ( args ) ;
346346 var handler = Assert . IsType < AsynchronousCommandLineAction > ( rootCommand . Subcommands . First ( c => c . Name == "plugin" ) . Action , exactMatch : false ) ;
347347
348- await handler . InvokeAsync ( parseResult ) ;
348+ await handler . InvokeAsync ( parseResult , TestContext . Current . CancellationToken ) ;
349349
350- using var jsDoc = JsonDocument . Parse ( await File . ReadAllTextAsync ( "ai-plugin.json" ) ) ;
350+ using var jsDoc = JsonDocument . Parse ( await File . ReadAllTextAsync ( "ai-plugin.json" , TestContext . Current . CancellationToken ) ) ;
351351 var openAiManifest = OpenAIPluginManifest . Load ( jsDoc . RootElement ) ;
352352
353353 Assert . NotNull ( openAiManifest ) ;
0 commit comments