diff options
| author | Bond_009 <bond.009@outlook.com> | 2023-09-18 17:55:52 +0200 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2023-09-18 17:55:52 +0200 |
| commit | 03b6adf068f007a66abbda515be940e702849d6b (patch) | |
| tree | b9918cfe31f712d11f382245dbfd725c7effac0a /tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs | |
| parent | 5669955aca4e7f187c0849095b35a5f93325d812 (diff) | |
Fix xUnit1030: Do not call ConfigureAwait in test method
Diffstat (limited to 'tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs')
| -rw-r--r-- | tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs b/tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs index 3737fee0a..3dc62afaf 100644 --- a/tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs +++ b/tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs @@ -21,10 +21,10 @@ namespace Jellyfin.Server.Integration.Tests public static async Task<string> CompleteStartupAsync(HttpClient client) { var jsonOptions = JsonDefaults.Options; - var userResponse = await client.GetByteArrayAsync("/Startup/User").ConfigureAwait(false); + var userResponse = await client.GetByteArrayAsync("/Startup/User"); var user = JsonSerializer.Deserialize<StartupUserDto>(userResponse, jsonOptions); - using var completeResponse = await client.PostAsync("/Startup/Complete", new ByteArrayContent(Array.Empty<byte>())).ConfigureAwait(false); + using var completeResponse = await client.PostAsync("/Startup/Complete", new ByteArrayContent(Array.Empty<byte>())); Assert.Equal(HttpStatusCode.NoContent, completeResponse.StatusCode); using var content = JsonContent.Create( @@ -36,20 +36,20 @@ namespace Jellyfin.Server.Integration.Tests options: jsonOptions); content.Headers.Add("X-Emby-Authorization", DummyAuthHeader); - using var authResponse = await client.PostAsync("/Users/AuthenticateByName", content).ConfigureAwait(false); + using var authResponse = await client.PostAsync("/Users/AuthenticateByName", content); var auth = await JsonSerializer.DeserializeAsync<AuthenticationResultDto>( - await authResponse.Content.ReadAsStreamAsync().ConfigureAwait(false), - jsonOptions).ConfigureAwait(false); + await authResponse.Content.ReadAsStreamAsync(), + jsonOptions); return auth!.AccessToken; } public static async Task<UserDto> GetUserDtoAsync(HttpClient client) { - using var response = await client.GetAsync("Users/Me").ConfigureAwait(false); + using var response = await client.GetAsync("Users/Me"); Assert.Equal(HttpStatusCode.OK, response.StatusCode); var userDto = await JsonSerializer.DeserializeAsync<UserDto>( - await response.Content.ReadAsStreamAsync().ConfigureAwait(false), JsonDefaults.Options).ConfigureAwait(false); + await response.Content.ReadAsStreamAsync(), JsonDefaults.Options); Assert.NotNull(userDto); return userDto; } @@ -58,15 +58,15 @@ namespace Jellyfin.Server.Integration.Tests { if (userId.Equals(default)) { - var userDto = await GetUserDtoAsync(client).ConfigureAwait(false); + var userDto = await GetUserDtoAsync(client); userId = userDto.Id; } - var response = await client.GetAsync($"Users/{userId}/Items/Root").ConfigureAwait(false); + var response = await client.GetAsync($"Users/{userId}/Items/Root"); Assert.Equal(HttpStatusCode.OK, response.StatusCode); var rootDto = await JsonSerializer.DeserializeAsync<BaseItemDto>( - await response.Content.ReadAsStreamAsync().ConfigureAwait(false), - JsonDefaults.Options).ConfigureAwait(false); + await response.Content.ReadAsStreamAsync(), + JsonDefaults.Options); Assert.NotNull(rootDto); return rootDto; } |
