From 40be86eec0fa7f43b64d05f30adcfab88ad3c402 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Wed, 1 Dec 2021 15:58:23 +0100 Subject: Use PostAsJsonAsync where possible --- .../Controllers/UserControllerTests.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'tests/Jellyfin.Server.Integration.Tests/Controllers/UserControllerTests.cs') diff --git a/tests/Jellyfin.Server.Integration.Tests/Controllers/UserControllerTests.cs b/tests/Jellyfin.Server.Integration.Tests/Controllers/UserControllerTests.cs index 0f8b930f1..f11f276f8 100644 --- a/tests/Jellyfin.Server.Integration.Tests/Controllers/UserControllerTests.cs +++ b/tests/Jellyfin.Server.Integration.Tests/Controllers/UserControllerTests.cs @@ -32,16 +32,10 @@ namespace Jellyfin.Server.Integration.Tests.Controllers } private Task CreateUserByName(HttpClient httpClient, CreateUserByName request) - { - using var postContent = JsonContent.Create(request, options: _jsonOpions); - return httpClient.PostAsync("Users/New", postContent); - } + => httpClient.PostAsJsonAsync("Users/New", request, _jsonOpions); private Task UpdateUserPassword(HttpClient httpClient, Guid userId, UpdateUserPassword request) - { - using var postContent = JsonContent.Create(request, options: _jsonOpions); - 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)] -- cgit v1.2.3