diff options
| author | Bond_009 <bond.009@outlook.com> | 2023-03-27 15:22:21 +0200 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2023-03-27 15:22:21 +0200 |
| commit | 8316bd590e4553953c7ca78e6eef26672fbcb416 (patch) | |
| tree | 0dd26967ec391cbcae9bf041054c668c5278ad0e /tests/Jellyfin.Server.Integration.Tests/Controllers/LibraryControllerTests.cs | |
| parent | 16bae527e56432fdc549882ae6f68505518f233c (diff) | |
Fix #7610
Diffstat (limited to 'tests/Jellyfin.Server.Integration.Tests/Controllers/LibraryControllerTests.cs')
| -rw-r--r-- | tests/Jellyfin.Server.Integration.Tests/Controllers/LibraryControllerTests.cs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/Jellyfin.Server.Integration.Tests/Controllers/LibraryControllerTests.cs b/tests/Jellyfin.Server.Integration.Tests/Controllers/LibraryControllerTests.cs index 013d19a9f..8998683a7 100644 --- a/tests/Jellyfin.Server.Integration.Tests/Controllers/LibraryControllerTests.cs +++ b/tests/Jellyfin.Server.Integration.Tests/Controllers/LibraryControllerTests.cs @@ -37,4 +37,27 @@ public sealed class LibraryControllerTests : IClassFixture<JellyfinApplicationFa var response = await client.GetAsync(string.Format(CultureInfo.InvariantCulture, format, Guid.NewGuid())).ConfigureAwait(false); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); } + + [Theory] + [InlineData("Items/{0}")] + [InlineData("Items?ids={0}")] + public async Task Delete_NonExistentItemId_Unauthorised(string format) + { + var client = _factory.CreateClient(); + + var response = await client.DeleteAsync(string.Format(CultureInfo.InvariantCulture, format, Guid.NewGuid())).ConfigureAwait(false); + Assert.Equal(HttpStatusCode.Unauthorized, response.StatusCode); + } + + [Theory] + [InlineData("Items/{0}")] + [InlineData("Items?ids={0}")] + public async Task Delete_NonExistentItemId_NotFound(string format) + { + var client = _factory.CreateClient(); + client.DefaultRequestHeaders.AddAuthHeader(_accessToken ??= await AuthHelper.CompleteStartupAsync(client).ConfigureAwait(false)); + + var response = await client.DeleteAsync(string.Format(CultureInfo.InvariantCulture, format, Guid.NewGuid())).ConfigureAwait(false); + Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + } } |
