Skip to content

Commit ed51df5

Browse files
committed
.
1 parent 861b555 commit ed51df5

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

src/Microsoft.OpenApi.Readers/OpenApiYamlDocumentReader.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,15 @@ public async Task<ReadResult> ReadAsync(YamlDocument input, CancellationToken ca
139139
};
140140
}
141141

142-
private async Task<OpenApiDiagnostic> LoadExternalRefs(OpenApiDocument document, CancellationToken cancellationToken = default)
142+
private Task<OpenApiDiagnostic> LoadExternalRefs(OpenApiDocument document, CancellationToken cancellationToken = default)
143143
{
144144
// Create workspace for all documents to live in.
145145
var openApiWorkSpace = new OpenApiWorkspace();
146146

147147
// Load this root document into the workspace
148148
var streamLoader = new DefaultStreamLoader(_settings.BaseUrl);
149149
var workspaceLoader = new OpenApiWorkspaceLoader(openApiWorkSpace, _settings.CustomExternalLoader ?? streamLoader, _settings);
150-
return await workspaceLoader.LoadAsync(new OpenApiReference { ExternalResource = "/" }, document, null, cancellationToken);
150+
return workspaceLoader.LoadAsync(new OpenApiReference { ExternalResource = "/" }, document, null, cancellationToken);
151151
}
152152

153153
private void ResolveReferences(OpenApiDiagnostic diagnostic, OpenApiDocument document)

test/Microsoft.OpenApi.Hidi.Tests/Services/OpenApiServiceTests.cs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -176,25 +176,25 @@ public async Task ShowCommandGeneratesMermaidMarkdownFileFromCsdlWithMermaidDiag
176176
}
177177

178178
[Fact]
179-
public async Task ThrowIfOpenApiUrlIsNotProvidedWhenValidating()
179+
public Task ThrowIfOpenApiUrlIsNotProvidedWhenValidating()
180180
{
181-
await Assert.ThrowsAsync<ArgumentNullException>(async () =>
182-
await OpenApiService.ValidateOpenApiDocument("", _logger));
181+
return Assert.ThrowsAsync<ArgumentNullException>(() =>
182+
OpenApiService.ValidateOpenApiDocument("", _logger));
183183
}
184184

185185

186186
[Fact]
187-
public async Task ThrowIfURLIsNotResolvableWhenValidating()
187+
public Task ThrowIfURLIsNotResolvableWhenValidating()
188188
{
189-
await Assert.ThrowsAsync<InvalidOperationException>(async () =>
190-
await OpenApiService.ValidateOpenApiDocument("https://example.org/itdoesnmatter", _logger));
189+
return Assert.ThrowsAsync<InvalidOperationException>(() =>
190+
OpenApiService.ValidateOpenApiDocument("https://example.org/itdoesnmatter", _logger));
191191
}
192192

193193
[Fact]
194-
public async Task ThrowIfFileDoesNotExistWhenValidating()
194+
public Task ThrowIfFileDoesNotExistWhenValidating()
195195
{
196-
await Assert.ThrowsAsync<InvalidOperationException>(async () =>
197-
await OpenApiService.ValidateOpenApiDocument("aFileThatBetterNotExist.fake", _logger));
196+
return Assert.ThrowsAsync<InvalidOperationException>(() =>
197+
OpenApiService.ValidateOpenApiDocument("aFileThatBetterNotExist.fake", _logger));
198198
}
199199

200200
[Fact]
@@ -284,7 +284,7 @@ public async Task TransformCommandConvertsOpenApiWithDefaultOutputNameAndSwitchF
284284
}
285285

286286
[Fact]
287-
public async Task ThrowTransformCommandIfOpenApiAndCsdlAreEmpty()
287+
public Task ThrowTransformCommandIfOpenApiAndCsdlAreEmpty()
288288
{
289289
HidiOptions options = new HidiOptions
290290
{
@@ -293,9 +293,8 @@ public async Task ThrowTransformCommandIfOpenApiAndCsdlAreEmpty()
293293
InlineLocal = false,
294294
InlineExternal = false,
295295
};
296-
await Assert.ThrowsAsync<ArgumentException>(async () =>
297-
await OpenApiService.TransformOpenApiDocument(options, _logger));
298-
296+
return Assert.ThrowsAsync<ArgumentException>(() =>
297+
OpenApiService.TransformOpenApiDocument(options, _logger));
299298
}
300299

301300
[Fact]

0 commit comments

Comments
 (0)