ActivityLogControllerTests.cs 1006 B

123456789101112131415161718192021222324252627282930
  1. using System.Net;
  2. using System.Net.Mime;
  3. using System.Threading.Tasks;
  4. using Xunit;
  5. namespace Jellyfin.Server.Integration.Tests.Controllers
  6. {
  7. public sealed class ActivityLogControllerTests : IClassFixture<JellyfinApplicationFactory>
  8. {
  9. private readonly JellyfinApplicationFactory _factory;
  10. private static string? _accessToken;
  11. public ActivityLogControllerTests(JellyfinApplicationFactory factory)
  12. {
  13. _factory = factory;
  14. }
  15. [Fact]
  16. public async Task ActivityLog_GetEntries_Ok()
  17. {
  18. var client = _factory.CreateClient();
  19. client.DefaultRequestHeaders.AddAuthHeader(_accessToken ??= await AuthHelper.CompleteStartupAsync(client));
  20. var response = await client.GetAsync("System/ActivityLog/Entries");
  21. Assert.Equal(HttpStatusCode.OK, response.StatusCode);
  22. Assert.Equal(MediaTypeNames.Application.Json, response.Content.Headers.ContentType?.MediaType);
  23. }
  24. }
  25. }