aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2023-10-08 14:07:38 +0200
committerGitHub <noreply@github.com>2023-10-08 14:07:38 +0200
commit406c5df8a37cad78281e0ab61cd5451673ee066a (patch)
treee48b09ab432123be8f7b2ca5a32ccc9bdf20f4f8 /tests
parent0b31997b2f5fa3245f80711d703a4247cfbb0363 (diff)
parent852f1dc0c1e3178955e2d1b2791b1e45f3f956b3 (diff)
Merge pull request #10345 from Bond-009/getperson
Diffstat (limited to 'tests')
-rw-r--r--tests/Jellyfin.Server.Integration.Tests/Controllers/PersonsControllerTests.cs26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/Jellyfin.Server.Integration.Tests/Controllers/PersonsControllerTests.cs b/tests/Jellyfin.Server.Integration.Tests/Controllers/PersonsControllerTests.cs
new file mode 100644
index 000000000..38c64547c
--- /dev/null
+++ b/tests/Jellyfin.Server.Integration.Tests/Controllers/PersonsControllerTests.cs
@@ -0,0 +1,26 @@
+using System.Net;
+using System.Threading.Tasks;
+using Xunit;
+
+namespace Jellyfin.Server.Integration.Tests.Controllers;
+
+public class PersonsControllerTests : IClassFixture<JellyfinApplicationFactory>
+{
+ private readonly JellyfinApplicationFactory _factory;
+ private static string? _accessToken;
+
+ public PersonsControllerTests(JellyfinApplicationFactory factory)
+ {
+ _factory = factory;
+ }
+
+ [Fact]
+ public async Task GetPerson_DoesntExist_NotFound()
+ {
+ var client = _factory.CreateClient();
+ client.DefaultRequestHeaders.AddAuthHeader(_accessToken ??= await AuthHelper.CompleteStartupAsync(client));
+
+ using var response = await client.GetAsync($"Persons/DoesntExist");
+ Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
+ }
+}