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): update dependency xunit to v2.5.1 #2535

Merged
merged 2 commits into from
Sep 18, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit" Version="2.5.1" />
<PackageReference Include="Xunit.Combinatorial" Version="1.5.25" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
<PackageReference Include="Xunit.SkippableFact" Version="1.4.13" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public async Task SignBlobAsync()

var credential = new ComputeCredential(initializer);

var signature = await credential.SignBlobAsync(Encoding.ASCII.GetBytes("ignored")).ConfigureAwait(false);
var signature = await credential.SignBlobAsync(Encoding.ASCII.GetBytes("ignored"));
Assert.Equal("Zm9v", signature);

Task<HttpResponseMessage> FetchServiceAccountId(HttpRequestMessage request)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public async Task GetOidcTokenAsync_Failure()
public async Task RequestAccessTokenAsync()
{
var credential = CreateImpersonatedCredentialWithAccessTokenResponse();
var success = await credential.RequestAccessTokenAsync(CancellationToken.None).ConfigureAwait(false);
var success = await credential.RequestAccessTokenAsync(CancellationToken.None);
Assert.True(success);
Assert.Equal(3600, credential.Token.ExpiresInSeconds);
Assert.Equal("access_token", credential.Token.AccessToken);
Expand All @@ -198,7 +198,7 @@ public async Task RequestAccessTokenAsync_Failure()
public async Task SignBlobAsync()
{
var credential = CreateImpersonatedCredentialWithSignBlobResponse();
var signature = await credential.SignBlobAsync(Encoding.ASCII.GetBytes("toSign")).ConfigureAwait(false);
var signature = await credential.SignBlobAsync(Encoding.ASCII.GetBytes("toSign"));
Assert.Equal("Zm9v", signature);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1036,14 +1036,14 @@ private async Task<IList<string>> LogTest(ConfigurableMessageHandler.LogEventTyp
[Fact]
public async Task Logging_RequestUri()
{
var logEntries = await LogTest(ConfigurableMessageHandler.LogEventType.RequestUri).ConfigureAwait(false);
var logEntries = await LogTest(ConfigurableMessageHandler.LogEventType.RequestUri);
Assert.Single(logEntries, "D2017-01-02 03:04:05.000000 Google.Apis.Http.ConfigurableMessageHandler Request[00000001] (triesRemaining=3) URI: 'https://test-host/'");
}

[Fact]
public async Task Logging_RequestHeaders()
{
var logEntries = await LogTest(ConfigurableMessageHandler.LogEventType.RequestHeaders).ConfigureAwait(false);
var logEntries = await LogTest(ConfigurableMessageHandler.LogEventType.RequestHeaders);
var entry = Assert.Single(logEntries);
// Header order may vary, and extra headers may be present (e.g. UserAgent), so test using Contain()
Assert.Contains("D2017-01-02 03:04:05.000000 Google.Apis.Http.ConfigurableMessageHandler Request[00000001] Headers:\n", entry);
Expand All @@ -1054,21 +1054,21 @@ public async Task Logging_RequestHeaders()
[Fact]
public async Task Logging_RequestBody()
{
var logEntries = await LogTest(ConfigurableMessageHandler.LogEventType.RequestBody).ConfigureAwait(false);
var logEntries = await LogTest(ConfigurableMessageHandler.LogEventType.RequestBody);
Assert.Single(logEntries, "D2017-01-02 03:04:05.000000 Google.Apis.Http.ConfigurableMessageHandler Request[00000001] Body: 'XYZ...DE'");
}

[Fact]
public async Task Logging_ResponseStatus()
{
var logEntries = await LogTest(ConfigurableMessageHandler.LogEventType.ResponseStatus).ConfigureAwait(false);
var logEntries = await LogTest(ConfigurableMessageHandler.LogEventType.ResponseStatus);
Assert.Single(logEntries, "D2017-01-02 03:04:05.000000 Google.Apis.Http.ConfigurableMessageHandler Response[00000001] Response status: OK 'OK'");
}

[Fact]
public async Task Logging_ResponseError()
{
var logEntries = await LogTest(ConfigurableMessageHandler.LogEventType.ResponseAbnormal, true).ConfigureAwait(false);
var logEntries = await LogTest(ConfigurableMessageHandler.LogEventType.ResponseAbnormal, true);
Assert.Equal(2, logEntries.Count);
Assert.Equal("D2017-01-02 03:04:05.000000 Google.Apis.Http.ConfigurableMessageHandler Response[00000001] An abnormal response wasn't handled. Status code is ServiceUnavailable", logEntries[0]);
Assert.Equal("D2017-01-02 03:04:05.000000 Google.Apis.Http.ConfigurableMessageHandler Response[00000001] Abnormal response is being returned. Status Code is ServiceUnavailable", logEntries[1]);
Expand All @@ -1077,7 +1077,7 @@ public async Task Logging_ResponseError()
[Fact]
public async Task Logging_ResponseHeaders()
{
var logEntries = await LogTest(ConfigurableMessageHandler.LogEventType.ResponseHeaders).ConfigureAwait(false);
var logEntries = await LogTest(ConfigurableMessageHandler.LogEventType.ResponseHeaders);
var entry = Assert.Single(logEntries);
Assert.Contains("D2017-01-02 03:04:05.000000 Google.Apis.Http.ConfigurableMessageHandler Response[00000001] Headers:\n", entry);
Assert.Contains(" [header1] 'One'", entry);
Expand All @@ -1087,7 +1087,7 @@ public async Task Logging_ResponseHeaders()
[Fact]
public async Task Logging_ResponseBody()
{
var logEntries = await LogTest(ConfigurableMessageHandler.LogEventType.ResponseBody).ConfigureAwait(false);
var logEntries = await LogTest(ConfigurableMessageHandler.LogEventType.ResponseBody);
Assert.Single(logEntries, "D2017-01-02 03:04:05.000000 Google.Apis.Http.ConfigurableMessageHandler Response[00000001] Body: 'ABC...DE'");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ void SubtestExecuteAsync_Test(bool successful2ndReponse)
}

[Fact]
public void ExecuteAsync_NoCallback_Test()
public async Task ExecuteAsync_NoCallback_Test()
{
var handler = new BatchMessageHandler(true);
var initializer = new BaseClientService.Initializer()
Expand All @@ -354,7 +354,7 @@ public void ExecuteAsync_NoCallback_Test()
});
batch.Queue<MockResponse>(request1, null);
batch.Queue<MockResponse>(request2, null);
batch.ExecuteAsync().Wait();
await batch.ExecuteAsync();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ public async Task ExecuteAsync_Error()

/// <summary>Tests async execution of multiple request simultaneously.</summary>
[Fact]
public void ExecuteAsync_Simultaneously()
public async Task ExecuteAsync_Simultaneously()
{
var tasks = new List<Task<MockResponse>>();
var handler = new ConcurrentCallsHandler();
Expand All @@ -665,14 +665,14 @@ public void ExecuteAsync_Simultaneously()
{
var request = new TestClientServiceRequest(service, "GET", null) { CallNum = i };
var task = request.ExecuteAsync();
task.ContinueWith(c => ce.Signal());
_ = task.ContinueWith(c => ce.Signal());
tasks.Add(task);
}
ce.Wait();

for (var i = 1; i <= tasks.Count; ++i)
{
var response = tasks[i - 1].Result;
var response = await tasks[i - 1];

// check that we got the right response. Name should be equal to the index number modulo 10 (or
// index number plus one module 10, if it's an even request - because even request should fail in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ public void StoreAndGet()
Assert.True(ds.StoreAsync("key", "value").IsCompleted);
var task = ds.GetAsync<string>("key");
Assert.True(task.IsCompleted);
#pragma warning disable xUnit1031 // Do not use blocking task operations in test method
Assert.Null(task.Result);
#pragma warning restore xUnit1031 // Do not use blocking task operations in test method
}
}
}
2 changes: 1 addition & 1 deletion Src/Support/Google.Apis.Tests/Google.Apis.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit" Version="2.5.1" />
<PackageReference Include="Xunit.Combinatorial" Version="1.5.25" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
<ProjectReference Include="..\Google.Apis\Google.Apis.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion Src/Support/IntegrationTests/IntegrationTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit" Version="2.5.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
<ProjectReference Include="..\Google.Apis.Auth\Google.Apis.Auth.csproj" />
<ProjectReference Include="..\Google.Apis.Tests\Google.Apis.Tests.csproj" />
Expand Down