aboutsummaryrefslogtreecommitdiff
path: root/tests/Jellyfin.Server.Integration.Tests/Controllers/UserControllerTests.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2023-10-13 10:45:15 +0200
committerGitHub <noreply@github.com>2023-10-13 10:45:15 +0200
commit4fc27fa63eb5a88a1a67a7ba67e969468f79a48d (patch)
tree3275848551b4a2c5a844bdbd2d14f0697637b79e /tests/Jellyfin.Server.Integration.Tests/Controllers/UserControllerTests.cs
parent5277339982f57c6e882db3313ee302667cce2ffb (diff)
parentd7748cfa0476280cce9dba34b4512cc58760c8bb (diff)
Merge pull request #10390 from Bond-009/streams
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);