VideosControllerTests.cs 839 B

123456789101112131415161718192021222324252627
  1. using System;
  2. using System.Net;
  3. using System.Threading.Tasks;
  4. using Xunit;
  5. namespace Jellyfin.Server.Integration.Tests.Controllers;
  6. public sealed class VideosControllerTests : IClassFixture<JellyfinApplicationFactory>
  7. {
  8. private readonly JellyfinApplicationFactory _factory;
  9. private static string? _accessToken;
  10. public VideosControllerTests(JellyfinApplicationFactory factory)
  11. {
  12. _factory = factory;
  13. }
  14. [Fact]
  15. public async Task DeleteAlternateSources_NonexistentItemId_NotFound()
  16. {
  17. var client = _factory.CreateClient();
  18. client.DefaultRequestHeaders.AddAuthHeader(_accessToken ??= await AuthHelper.CompleteStartupAsync(client));
  19. var response = await client.DeleteAsync($"Videos/{Guid.NewGuid()}");
  20. Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
  21. }
  22. }