aboutsummaryrefslogtreecommitdiff
path: root/tests/Jellyfin.Server.Integration.Tests/Controllers/DashboardControllerTests.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/DashboardControllerTests.cs
parent5277339982f57c6e882db3313ee302667cce2ffb (diff)
parentd7748cfa0476280cce9dba34b4512cc58760c8bb (diff)
Merge pull request #10390 from Bond-009/streams
Diffstat (limited to 'tests/Jellyfin.Server.Integration.Tests/Controllers/DashboardControllerTests.cs')
-rw-r--r--tests/Jellyfin.Server.Integration.Tests/Controllers/DashboardControllerTests.cs7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/Jellyfin.Server.Integration.Tests/Controllers/DashboardControllerTests.cs b/tests/Jellyfin.Server.Integration.Tests/Controllers/DashboardControllerTests.cs
index bd6e1b690..39d449e27 100644
--- a/tests/Jellyfin.Server.Integration.Tests/Controllers/DashboardControllerTests.cs
+++ b/tests/Jellyfin.Server.Integration.Tests/Controllers/DashboardControllerTests.cs
@@ -1,5 +1,6 @@
using System.IO;
using System.Net;
+using System.Net.Http.Json;
using System.Net.Mime;
using System.Text;
using System.Text.Json;
@@ -64,8 +65,7 @@ namespace Jellyfin.Server.Integration.Tests.Controllers
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var res = await response.Content.ReadAsStreamAsync();
- _ = await JsonSerializer.DeserializeAsync<ConfigurationPageInfo[]>(res, _jsonOpions);
+ _ = await response.Content.ReadFromJsonAsync<ConfigurationPageInfo[]>(_jsonOpions);
// TODO: check content
}
@@ -81,8 +81,7 @@ namespace Jellyfin.Server.Integration.Tests.Controllers
Assert.Equal(MediaTypeNames.Application.Json, response.Content.Headers.ContentType?.MediaType);
Assert.Equal(Encoding.UTF8.BodyName, response.Content.Headers.ContentType?.CharSet);
- var res = await response.Content.ReadAsStreamAsync();
- var data = await JsonSerializer.DeserializeAsync<ConfigurationPageInfo[]>(res, _jsonOpions);
+ var data = await response.Content.ReadFromJsonAsync<ConfigurationPageInfo[]>(_jsonOpions);
Assert.NotNull(data);
Assert.Empty(data);
}