1- using Xunit ;
2- using Microsoft . OpenApi . Reader ;
3- using System . Threading . Tasks ;
1+ using System ;
42using System . IO ;
5- using System ;
63using System . Threading ;
4+ using System . Threading . Tasks ;
5+ using Microsoft . OpenApi . Reader ;
76using Microsoft . OpenApi . YamlReader ;
7+ using Xunit ;
88
99namespace Microsoft . OpenApi . Tests . Reader ;
1010
@@ -232,7 +232,7 @@ await File.WriteAllTextAsync(tempFilePathReferrer,
232232 var baseUri = new Uri ( tempFilePathReferrer ) ;
233233 var settings = new OpenApiReaderSettings
234234 {
235- BaseUrl = baseUri ,
235+ BaseUrl = baseUri ,
236236 } ;
237237 var readResult = await OpenApiDocument . LoadAsync ( stream , settings : settings , cancellationToken : TestContext . Current . CancellationToken ) ;
238238 Assert . Equal ( OpenApiConstants . Json , readResult . Diagnostic . Format ) ;
@@ -265,10 +265,10 @@ public async Task CanLoadANonSeekableStreamInJsonAndDetectFormat()
265265 // Given
266266 using var memoryStream = new MemoryStream ( System . Text . Encoding . UTF8 . GetBytes ( documentJson ) ) ;
267267 using var nonSeekableStream = new NonSeekableStream ( memoryStream ) ;
268-
268+
269269 // When
270270 var ( document , _) = await OpenApiDocument . LoadAsync ( nonSeekableStream , cancellationToken : TestContext . Current . CancellationToken ) ;
271-
271+
272272 // Then
273273 Assert . NotNull ( document ) ;
274274 Assert . Equal ( "Sample API" , document . Info . Title ) ;
@@ -282,10 +282,10 @@ public async Task CanLoadANonSeekableStreamInYamlAndDetectFormat()
282282 using var nonSeekableStream = new NonSeekableStream ( memoryStream ) ;
283283 var settings = new OpenApiReaderSettings ( ) ;
284284 settings . AddYamlReader ( ) ;
285-
285+
286286 // When
287287 var ( document , _) = await OpenApiDocument . LoadAsync ( nonSeekableStream , settings : settings , cancellationToken : TestContext . Current . CancellationToken ) ;
288-
288+
289289 // Then
290290 Assert . NotNull ( document ) ;
291291 Assert . Equal ( "Sample API" , document . Info . Title ) ;
@@ -297,10 +297,10 @@ public async Task CanLoadAnAsyncOnlyStreamInJsonAndDetectFormat()
297297 // Given
298298 await using var memoryStream = new MemoryStream ( System . Text . Encoding . UTF8 . GetBytes ( documentJson ) ) ;
299299 await using var nonSeekableStream = new AsyncOnlyStream ( memoryStream ) ;
300-
300+
301301 // When
302302 var ( document , _) = await OpenApiDocument . LoadAsync ( nonSeekableStream , cancellationToken : TestContext . Current . CancellationToken ) ;
303-
303+
304304 // Then
305305 Assert . NotNull ( document ) ;
306306 Assert . Equal ( "Sample API" , document . Info . Title ) ;
@@ -314,10 +314,10 @@ public async Task CanLoadAnAsyncOnlyStreamInYamlAndDetectFormat()
314314 await using var nonSeekableStream = new AsyncOnlyStream ( memoryStream ) ;
315315 var settings = new OpenApiReaderSettings ( ) ;
316316 settings . AddYamlReader ( ) ;
317-
317+
318318 // When
319319 var ( document , _) = await OpenApiDocument . LoadAsync ( nonSeekableStream , settings : settings , cancellationToken : TestContext . Current . CancellationToken ) ;
320-
320+
321321 // Then
322322 Assert . NotNull ( document ) ;
323323 Assert . Equal ( "Sample API" , document . Info . Title ) ;
@@ -329,10 +329,10 @@ public async Task CanLoadANonSeekableStreamInJsonAndDetectFormatWhenPrecededBySp
329329 // Given
330330 using var memoryStream = new MemoryStream ( System . Text . Encoding . UTF8 . GetBytes ( " " + documentJson ) ) ;
331331 using var nonSeekableStream = new NonSeekableStream ( memoryStream ) ;
332-
332+
333333 // When
334334 var ( document , _) = await OpenApiDocument . LoadAsync ( nonSeekableStream , cancellationToken : TestContext . Current . CancellationToken ) ;
335-
335+
336336 // Then
337337 Assert . NotNull ( document ) ;
338338 Assert . Equal ( "Sample API" , document . Info . Title ) ;
@@ -343,7 +343,7 @@ public void CanLoadAStringJsonAndDetectFormatWhenPrecededBySpaces()
343343 {
344344 // When
345345 var ( document , _) = OpenApiDocument . Parse ( " " + documentJson ) ;
346-
346+
347347 // Then
348348 Assert . NotNull ( document ) ;
349349 Assert . Equal ( "Sample API" , document . Info . Title ) ;
0 commit comments