diff options
| author | Bond_009 <bond.009@outlook.com> | 2021-12-01 15:58:23 +0100 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2021-12-01 15:58:23 +0100 |
| commit | 40be86eec0fa7f43b64d05f30adcfab88ad3c402 (patch) | |
| tree | 35fef4b8f6db6c0df9a91ed5059150bfabb85d3d /tests/Jellyfin.Server.Integration.Tests/Controllers/DlnaControllerTests.cs | |
| parent | beafd6eaabf7baa7c478b4a0ef131ddc480b368a (diff) | |
Use PostAsJsonAsync where possible
Diffstat (limited to 'tests/Jellyfin.Server.Integration.Tests/Controllers/DlnaControllerTests.cs')
| -rw-r--r-- | tests/Jellyfin.Server.Integration.Tests/Controllers/DlnaControllerTests.cs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/Jellyfin.Server.Integration.Tests/Controllers/DlnaControllerTests.cs b/tests/Jellyfin.Server.Integration.Tests/Controllers/DlnaControllerTests.cs index 8a03583bb..4c46933aa 100644 --- a/tests/Jellyfin.Server.Integration.Tests/Controllers/DlnaControllerTests.cs +++ b/tests/Jellyfin.Server.Integration.Tests/Controllers/DlnaControllerTests.cs @@ -63,8 +63,7 @@ namespace Jellyfin.Server.Integration.Tests.Controllers Name = "ThisProfileDoesNotExist" }; - using var content = JsonContent.Create(deviceProfile, options: _jsonOptions); - using var getResponse = await client.PostAsync("/Dlna/Profiles/" + NonExistentProfile, content).ConfigureAwait(false); + using var getResponse = await client.PostAsJsonAsync("/Dlna/Profiles/" + NonExistentProfile, deviceProfile, _jsonOptions).ConfigureAwait(false); Assert.Equal(HttpStatusCode.NotFound, getResponse.StatusCode); } @@ -80,8 +79,7 @@ namespace Jellyfin.Server.Integration.Tests.Controllers Name = "ThisProfileIsNew" }; - using var content = JsonContent.Create(deviceProfile, options: _jsonOptions); - using var getResponse = await client.PostAsync("/Dlna/Profiles", content).ConfigureAwait(false); + using var getResponse = await client.PostAsJsonAsync("/Dlna/Profiles", deviceProfile, _jsonOptions).ConfigureAwait(false); Assert.Equal(HttpStatusCode.NoContent, getResponse.StatusCode); } @@ -119,8 +117,7 @@ namespace Jellyfin.Server.Integration.Tests.Controllers Id = _newDeviceProfileId }; - using var content = JsonContent.Create(updatedProfile, options: _jsonOptions); - using var getResponse = await client.PostAsync("/Dlna/Profiles", content).ConfigureAwait(false); + using var getResponse = await client.PostAsJsonAsync("/Dlna/Profiles", updatedProfile, _jsonOptions).ConfigureAwait(false); Assert.Equal(HttpStatusCode.NoContent, getResponse.StatusCode); } |
