Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): bump xunit from 2.5.3 to 2.6.0 #40

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/lib/Helpers/ParsingHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,14 @@ internal static async Task<ReadResult> ParseOpenApiAsync(Uri openApiFileUri, boo
return await ParseOpenApiAsync(stream, openApiFileUri, inlineExternal, cancellationToken).ConfigureAwait(false);
}

internal static async Task<ReadResult> ParseOpenApiAsync(Stream stream, Uri openApiFileUri, bool inlineExternal, CancellationToken cancellationToken)
internal static Task<ReadResult> ParseOpenApiAsync(Stream stream, Uri openApiFileUri, bool inlineExternal, CancellationToken cancellationToken)
{
ReadResult result = await new OpenApiStreamReader(new OpenApiReaderSettings
return new OpenApiStreamReader(new OpenApiReaderSettings
{
LoadExternalRefs = inlineExternal,
BaseUrl = openApiFileUri
}
).ReadAsync(stream, cancellationToken).ConfigureAwait(false);

return result;
).ReadAsync(stream, cancellationToken);
}

internal static async Task<Stream> GetStreamAsync(Uri uri, CancellationToken cancellationToken = default)
Expand Down
2 changes: 1 addition & 1 deletion tests/ApiManifest.Tests/ApiManifest.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="xunit" Version="2.6.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
9 changes: 5 additions & 4 deletions tests/ApiManifest.Tests/Helpers/ParsingHelpersTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT license.

using Microsoft.OpenApi.ApiManifest.Helpers;
using Microsoft.OpenApi.Readers.Exceptions;
using System.Text.Json;

namespace Microsoft.OpenApi.ApiManifest.Tests.Helpers
Expand Down Expand Up @@ -124,17 +125,17 @@ public async Task ParseOpenApiAsync()
}

[Fact]
public void ParseOpenApiWithWrongOpenApiUrl()
public async Task ParseOpenApiWithWrongOpenApiUrl()
{
var openApiUri = new Uri("https://contoso.com/NotValid.yaml");
_ = Assert.ThrowsAsync<InvalidOperationException>(async () => await ParsingHelpers.ParseOpenApiAsync(openApiUri, false, CancellationToken.None));
_ = await Assert.ThrowsAsync<OpenApiUnsupportedSpecVersionException>(() => ParsingHelpers.ParseOpenApiAsync(openApiUri, false, CancellationToken.None));
}

[Fact]
public void ParseOpenApiWithOpenApiUrlWithAnInvalidSchema()
public async Task ParseOpenApiWithOpenApiUrlWithAnInvalidSchema()
{
var openApiUri = new Uri("xyx://contoso.com/openapi.yaml");
_ = Assert.ThrowsAsync<ArgumentException>(async () => await ParsingHelpers.ParseOpenApiAsync(openApiUri, false, CancellationToken.None));
_ = await Assert.ThrowsAsync<ArgumentException>(() => ParsingHelpers.ParseOpenApiAsync(openApiUri, false, CancellationToken.None));
}
}
}
12 changes: 6 additions & 6 deletions tests/ApiManifest.Tests/OpenAIPluginManifestTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -531,20 +531,20 @@ public async Task GenerateOpenAIPluginManifestFromApiManifestOfAnApiDependencyAs
}

[Fact]
public void GenerateOpenAIPluginManifestFromApiManifestWithWrongApiDependency()
public async Task GenerateOpenAIPluginManifestFromApiManifestWithWrongApiDependency()
{
_ = Assert.ThrowsAsync<ApiManifestException>(
async () => await exampleApiManifest.ToOpenAIPluginManifestAsync("https://avatars.githubusercontent.com/bar", "https://legalinfo.foobar.com", "ContosoApi", "./openapi.yml"));
_ = await Assert.ThrowsAsync<ApiManifestException>(
() => exampleApiManifest.ToOpenAIPluginManifestAsync("https://avatars.githubusercontent.com/bar", "https://legalinfo.foobar.com", "ContosoApi", "./openapi.yml"));
}

[Fact]
public void GenerateOpenAIPluginManifestFromApiManifestWithEmptyApiDependencies()
public async Task GenerateOpenAIPluginManifestFromApiManifestWithEmptyApiDependencies()
{
var apiManifest = LoadTestApiManifestDocument();
apiManifest.ApiDependencies.Clear();

_ = Assert.ThrowsAsync<ApiManifestException>(
async () => await apiManifest.ToOpenAIPluginManifestAsync("https://avatars.githubusercontent.com/bar", "https://legalinfo.foobar.com", "MicrosoftGraph", "./openapi.yml"));
_ = await Assert.ThrowsAsync<ApiManifestException>(
() => apiManifest.ToOpenAIPluginManifestAsync("https://avatars.githubusercontent.com/bar", "https://legalinfo.foobar.com", "MicrosoftGraph", "./openapi.yml"));
}

private static OpenAIPluginManifest CreateManifestPlugIn()
Expand Down
Loading