File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
test/Microsoft.OpenApi.Readers.Tests Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 1- // Copyright (c) Microsoft Corporation. All rights reserved.
1+ // Copyright (c) Microsoft Corporation. All rights reserved.
22// Licensed under the MIT license.
33
44using System ;
@@ -49,7 +49,7 @@ public async Task StreamShouldNotBeDisposedIfLeaveStreamOpenSettingIsTrueAsync()
4949 memoryStream . Position = 0 ;
5050 var stream = memoryStream ;
5151
52- var result = OpenApiDocument . Load ( stream , "yaml" , new OpenApiReaderSettings { LeaveStreamOpen = true } ) ;
52+ _ = await OpenApiDocument . LoadAsync ( stream , "yaml" , new OpenApiReaderSettings { LeaveStreamOpen = true } ) ;
5353 stream . Seek ( 0 , SeekOrigin . Begin ) ; // does not throw an object disposed exception
5454 Assert . True ( stream . CanRead ) ;
5555 }
@@ -65,7 +65,7 @@ public async Task StreamShouldReadWhenInitializedAsync()
6565 var stream = await httpClient . GetStreamAsync ( "20fe7a7b720a0e48e5842d002ac418b12a8201df/tests/v3.0/pass/petstore.yaml" ) ;
6666
6767 // Read V3 as YAML
68- var result = OpenApiDocument . Load ( stream , "yaml" ) ;
68+ var result = await OpenApiDocument . LoadAsync ( stream , "yaml" ) ;
6969 Assert . NotNull ( result . OpenApiDocument ) ;
7070 }
7171 }
Original file line number Diff line number Diff line change @@ -522,9 +522,9 @@ public async Task ParseExternalDocumentDereferenceToOpenApiDocumentByIdWorks()
522522
523523 // Act
524524 var result = await OpenApiDocument . LoadAsync ( Path . Combine ( SampleFolderPath , "externalRefById.yaml" ) , settings ) ;
525- var doc2 = OpenApiDocument . Load ( Path . Combine ( SampleFolderPath , "externalResource.yaml" ) ) . OpenApiDocument ;
525+ var doc2 = ( await OpenApiDocument . LoadAsync ( Path . Combine ( SampleFolderPath , "externalResource.yaml" ) ) ) . OpenApiDocument ;
526526
527- var requestBodySchema = result . OpenApiDocument . Paths [ "/resource" ] . Operations [ OperationType . Get ] . Parameters . First ( ) . Schema ;
527+ var requestBodySchema = result . OpenApiDocument . Paths [ "/resource" ] . Operations [ OperationType . Get ] . Parameters [ 0 ] . Schema ;
528528 result . OpenApiDocument . Workspace . RegisterComponents ( doc2 ) ;
529529
530530 // Assert
@@ -535,10 +535,10 @@ public async Task ParseExternalDocumentDereferenceToOpenApiDocumentByIdWorks()
535535 public async Task ParseDocumentWith31PropertiesWorks ( )
536536 {
537537 var path = Path . Combine ( SampleFolderPath , "documentWith31Properties.yaml" ) ;
538- var doc = OpenApiDocument . Load ( path ) . OpenApiDocument ;
538+ var doc = ( await OpenApiDocument . LoadAsync ( path ) ) . OpenApiDocument ;
539539 var outputStringWriter = new StringWriter ( ) ;
540540 doc . SerializeAsV31 ( new OpenApiYamlWriter ( outputStringWriter ) ) ;
541- outputStringWriter . Flush ( ) ;
541+ await outputStringWriter . FlushAsync ( ) ;
542542 var actual = outputStringWriter . GetStringBuilder ( ) . ToString ( ) ;
543543
544544 // Assert
You can’t perform that action at this time.
0 commit comments