diff options
| author | Claus Vium <cvium@users.noreply.github.com> | 2021-12-07 20:16:32 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-07 20:16:32 +0100 |
| commit | 3f69eeab276052ad54f8113c94cc2443e2ab4c3d (patch) | |
| tree | 136de6b3825ac55e197626948cf1a88f72be27ff /tests/Jellyfin.Server.Integration.Tests/Controllers/UserControllerTests.cs | |
| parent | 99a48554a618302b4fe70ef1fd3d7fd06096c70e (diff) | |
| parent | dd8b9e9d2367893f2865d07dbe3a11c1adf6c631 (diff) | |
Merge branch 'master' into support-external-audio-files
Diffstat (limited to 'tests/Jellyfin.Server.Integration.Tests/Controllers/UserControllerTests.cs')
| -rw-r--r-- | tests/Jellyfin.Server.Integration.Tests/Controllers/UserControllerTests.cs | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/tests/Jellyfin.Server.Integration.Tests/Controllers/UserControllerTests.cs b/tests/Jellyfin.Server.Integration.Tests/Controllers/UserControllerTests.cs index 8866ab53c..f11f276f8 100644 --- a/tests/Jellyfin.Server.Integration.Tests/Controllers/UserControllerTests.cs +++ b/tests/Jellyfin.Server.Integration.Tests/Controllers/UserControllerTests.cs @@ -3,6 +3,7 @@ using System.Globalization; using System.Linq; using System.Net; using System.Net.Http; +using System.Net.Http.Json; using System.Net.Http.Headers; using System.Net.Mime; using System.Text.Json; @@ -31,18 +32,10 @@ namespace Jellyfin.Server.Integration.Tests.Controllers } private Task<HttpResponseMessage> CreateUserByName(HttpClient httpClient, CreateUserByName request) - { - using var postContent = new ByteArrayContent(JsonSerializer.SerializeToUtf8Bytes(request, _jsonOpions)); - postContent.Headers.ContentType = MediaTypeHeaderValue.Parse(MediaTypeNames.Application.Json); - return httpClient.PostAsync("Users/New", postContent); - } + => httpClient.PostAsJsonAsync("Users/New", request, _jsonOpions); private Task<HttpResponseMessage> UpdateUserPassword(HttpClient httpClient, Guid userId, UpdateUserPassword request) - { - using var postContent = new ByteArrayContent(JsonSerializer.SerializeToUtf8Bytes(request, _jsonOpions)); - postContent.Headers.ContentType = MediaTypeHeaderValue.Parse(MediaTypeNames.Application.Json); - return httpClient.PostAsync("Users/" + userId.ToString("N", CultureInfo.InvariantCulture) + "/Password", postContent); - } + => httpClient.PostAsJsonAsync("Users/" + userId.ToString("N", CultureInfo.InvariantCulture) + "/Password", request, _jsonOpions); [Fact] [Priority(-1)] |
