aboutsummaryrefslogtreecommitdiff
path: root/tests/Jellyfin.Server.Integration.Tests/Controllers/UserLibraryControllerTests.cs
diff options
context:
space:
mode:
authorStepan Goremykin <goremukin@gmail.com>2023-10-14 00:45:52 +0200
committerStepan Goremykin <goremukin@gmail.com>2023-10-14 00:45:52 +0200
commit38d962242ad0b4d3cf10b175836bf1e5e9b60d39 (patch)
treeaa0c164036ea9e628f38fa14a3d29635f7ffd042 /tests/Jellyfin.Server.Integration.Tests/Controllers/UserLibraryControllerTests.cs
parenta773b43a814e6e849bbb5eb0fa1bccf09a4c1945 (diff)
parent4fc27fa63eb5a88a1a67a7ba67e969468f79a48d (diff)
Merge branch 'master' into fix-resharper-warnings
# Conflicts: # Emby.Server.Implementations/Updates/InstallationManager.cs # tests/Jellyfin.Server.Integration.Tests/OpenApiSpecTests.cs
Diffstat (limited to 'tests/Jellyfin.Server.Integration.Tests/Controllers/UserLibraryControllerTests.cs')
-rw-r--r--tests/Jellyfin.Server.Integration.Tests/Controllers/UserLibraryControllerTests.cs13
1 files changed, 4 insertions, 9 deletions
diff --git a/tests/Jellyfin.Server.Integration.Tests/Controllers/UserLibraryControllerTests.cs b/tests/Jellyfin.Server.Integration.Tests/Controllers/UserLibraryControllerTests.cs
index 826a0a69d..130281c6d 100644
--- a/tests/Jellyfin.Server.Integration.Tests/Controllers/UserLibraryControllerTests.cs
+++ b/tests/Jellyfin.Server.Integration.Tests/Controllers/UserLibraryControllerTests.cs
@@ -1,6 +1,7 @@
using System;
using System.Globalization;
using System.Net;
+using System.Net.Http.Json;
using System.Text.Json;
using System.Threading.Tasks;
using Jellyfin.Extensions.Json;
@@ -85,9 +86,7 @@ public sealed class UserLibraryControllerTests : IClassFixture<JellyfinApplicati
var response = await client.GetAsync($"Users/{userDto.Id}/Items/{rootFolderDto.Id}");
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var rootDto = await JsonSerializer.DeserializeAsync<BaseItemDto>(
- await response.Content.ReadAsStreamAsync(),
- _jsonOptions);
+ var rootDto = await response.Content.ReadFromJsonAsync<BaseItemDto>(_jsonOptions);
Assert.NotNull(rootDto);
}
@@ -102,9 +101,7 @@ public sealed class UserLibraryControllerTests : IClassFixture<JellyfinApplicati
var response = await client.GetAsync($"Users/{userDto.Id}/Items/{rootFolderDto.Id}/Intros");
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var rootDto = await JsonSerializer.DeserializeAsync<QueryResult<BaseItemDto>>(
- await response.Content.ReadAsStreamAsync(),
- _jsonOptions);
+ var rootDto = await response.Content.ReadFromJsonAsync<QueryResult<BaseItemDto>>(_jsonOptions);
Assert.NotNull(rootDto);
}
@@ -121,9 +118,7 @@ public sealed class UserLibraryControllerTests : IClassFixture<JellyfinApplicati
var response = await client.GetAsync(string.Format(CultureInfo.InvariantCulture, format, userDto.Id, rootFolderDto.Id));
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var rootDto = await JsonSerializer.DeserializeAsync<BaseItemDto[]>(
- await response.Content.ReadAsStreamAsync(),
- _jsonOptions);
+ var rootDto = await response.Content.ReadFromJsonAsync<BaseItemDto[]>(_jsonOptions);
Assert.NotNull(rootDto);
}
}