aboutsummaryrefslogtreecommitdiff
path: root/tests/Jellyfin.Server.Integration.Tests/Controllers/UserControllerTests.cs
diff options
context:
space:
mode:
authorPithaya <19533412+Pithaya@users.noreply.github.com>2023-11-13 18:07:23 +0100
committerGitHub <noreply@github.com>2023-11-13 18:07:23 +0100
commiteb2bcc91c5e8182bddf1ab5d6ee2a951da66e9c6 (patch)
tree97bf08a7c3f3ebae72c0c89ffccd2917fad3cb2c /tests/Jellyfin.Server.Integration.Tests/Controllers/UserControllerTests.cs
parent948a67cfeb1aa045099c4486da4eb1fd459a676f (diff)
parentea546230586a00a75db5c379db904e47cbbf270b (diff)
Merge branch 'master' into feat/book-persons
Diffstat (limited to 'tests/Jellyfin.Server.Integration.Tests/Controllers/UserControllerTests.cs')
-rw-r--r--tests/Jellyfin.Server.Integration.Tests/Controllers/UserControllerTests.cs9
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/Jellyfin.Server.Integration.Tests/Controllers/UserControllerTests.cs b/tests/Jellyfin.Server.Integration.Tests/Controllers/UserControllerTests.cs
index 79d03d539..4fcacd2ca 100644
--- a/tests/Jellyfin.Server.Integration.Tests/Controllers/UserControllerTests.cs
+++ b/tests/Jellyfin.Server.Integration.Tests/Controllers/UserControllerTests.cs
@@ -43,8 +43,7 @@ namespace Jellyfin.Server.Integration.Tests.Controllers
using var response = await client.GetAsync("Users/Public");
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var users = await JsonSerializer.DeserializeAsync<UserDto[]>(
- await response.Content.ReadAsStreamAsync(), _jsonOpions);
+ var users = await response.Content.ReadFromJsonAsync<UserDto[]>(_jsonOpions);
// User are hidden by default
Assert.NotNull(users);
Assert.Empty(users);
@@ -59,8 +58,7 @@ namespace Jellyfin.Server.Integration.Tests.Controllers
using var response = await client.GetAsync("Users");
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var users = await JsonSerializer.DeserializeAsync<UserDto[]>(
- await response.Content.ReadAsStreamAsync(), _jsonOpions);
+ var users = await response.Content.ReadFromJsonAsync<UserDto[]>(_jsonOpions);
Assert.NotNull(users);
Assert.Single(users);
Assert.False(users![0].HasConfiguredPassword);
@@ -92,8 +90,7 @@ namespace Jellyfin.Server.Integration.Tests.Controllers
using var response = await CreateUserByName(client, createRequest);
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var user = await JsonSerializer.DeserializeAsync<UserDto>(
- await response.Content.ReadAsStreamAsync(), _jsonOpions);
+ var user = await response.Content.ReadFromJsonAsync<UserDto>(_jsonOpions);
Assert.Equal(TestUsername, user!.Name);
Assert.False(user.HasPassword);
Assert.False(user.HasConfiguredPassword);