aboutsummaryrefslogtreecommitdiff
path: root/tests/Jellyfin.Server.Integration.Tests/Controllers/LibraryControllerTests.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2023-03-29 12:20:34 +0200
committerGitHub <noreply@github.com>2023-03-29 12:20:34 +0200
commita1eddbb330ba0ef034a311b36d150c876e99159b (patch)
tree499001adde7a3ebc4064d569fe098c83ec812ca1 /tests/Jellyfin.Server.Integration.Tests/Controllers/LibraryControllerTests.cs
parent9c500bdca3330607a2a0dd9a562548750f99f11b (diff)
parent8316bd590e4553953c7ca78e6eef26672fbcb416 (diff)
Merge pull request #9541 from Bond-009/apikeydelete
Diffstat (limited to 'tests/Jellyfin.Server.Integration.Tests/Controllers/LibraryControllerTests.cs')
-rw-r--r--tests/Jellyfin.Server.Integration.Tests/Controllers/LibraryControllerTests.cs23
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);
+ }
}