aboutsummaryrefslogtreecommitdiff
path: root/tests/Jellyfin.Server.Integration.Tests/Controllers/LibraryControllerTests.cs
diff options
context:
space:
mode:
authorShadowghost <Ghost_of_Stone@web.de>2023-05-09 15:25:41 +0200
committerShadowghost <Ghost_of_Stone@web.de>2023-05-09 15:25:41 +0200
commit6cc1203c1b423ee2765be7e33aad56be374c8314 (patch)
tree57ce21874de41124f2626c5f06328bcb2e9734d5 /tests/Jellyfin.Server.Integration.Tests/Controllers/LibraryControllerTests.cs
parent520c07e8cad3e4372f6a5214160d1600106a7bfd (diff)
parent92a0d26f31743ca0015fcc3e0a4fe094792ac63c (diff)
Merge branch 'master' into network-rewrite
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);
+ }
}