diff options
| author | Jonas Resch <jonas.resch@live.de> | 2021-12-08 09:55:16 +0100 |
|---|---|---|
| committer | Jonas Resch <jonas.resch@live.de> | 2021-12-08 09:55:16 +0100 |
| commit | 87a6fdf8478cf8daa24dc44a2a3da451be06b950 (patch) | |
| tree | c5d147e9f05ee5e1c28094236f0a4caa7bab9069 /tests/Jellyfin.Server.Integration.Tests/Controllers/MediaStructureControllerTests.cs | |
| parent | ca2d94ee97b53a69f4508f4ef5ac72a72d2a3aa5 (diff) | |
| parent | a327b43ab7faceadb555890c41f103008fc00737 (diff) | |
Merge branch 'support-external-audio-files' of github.com:jonas-resch/jellyfin into support-external-audio-files
Diffstat (limited to 'tests/Jellyfin.Server.Integration.Tests/Controllers/MediaStructureControllerTests.cs')
| -rw-r--r-- | tests/Jellyfin.Server.Integration.Tests/Controllers/MediaStructureControllerTests.cs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/Jellyfin.Server.Integration.Tests/Controllers/MediaStructureControllerTests.cs b/tests/Jellyfin.Server.Integration.Tests/Controllers/MediaStructureControllerTests.cs index 19d8381ea..2da5237db 100644 --- a/tests/Jellyfin.Server.Integration.Tests/Controllers/MediaStructureControllerTests.cs +++ b/tests/Jellyfin.Server.Integration.Tests/Controllers/MediaStructureControllerTests.cs @@ -1,6 +1,7 @@ using System; using System.Net; using System.Net.Http; +using System.Net.Http.Json; using System.Net.Http.Headers; using System.Net.Mime; using System.Text.Json; @@ -71,9 +72,7 @@ namespace Jellyfin.Server.Integration.Tests.Controllers Path = "/this/path/doesnt/exist" }; - using var postContent = new ByteArrayContent(JsonSerializer.SerializeToUtf8Bytes(data, _jsonOptions)); - postContent.Headers.ContentType = MediaTypeHeaderValue.Parse(MediaTypeNames.Application.Json); - var response = await client.PostAsync("Library/VirtualFolders/Paths", postContent).ConfigureAwait(false); + var response = await client.PostAsJsonAsync("Library/VirtualFolders/Paths", data, _jsonOptions).ConfigureAwait(false); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); } @@ -90,9 +89,7 @@ namespace Jellyfin.Server.Integration.Tests.Controllers PathInfo = new MediaPathInfo("test") }; - using var postContent = new ByteArrayContent(JsonSerializer.SerializeToUtf8Bytes(data, _jsonOptions)); - postContent.Headers.ContentType = MediaTypeHeaderValue.Parse(MediaTypeNames.Application.Json); - var response = await client.PostAsync("Library/VirtualFolders/Paths/Update", postContent).ConfigureAwait(false); + var response = await client.PostAsJsonAsync("Library/VirtualFolders/Paths/Update", data, _jsonOptions).ConfigureAwait(false); Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); } |
