mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-11-04 21:25:59 +00:00
37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
using System.Net;
|
|
using System.Threading.Tasks;
|
|
using Xunit;
|
|
|
|
namespace Jellyfin.Server.Integration.Tests.Controllers;
|
|
|
|
public sealed class SyncPlayControllerTests : IClassFixture<JellyfinApplicationFactory>
|
|
{
|
|
private readonly JellyfinApplicationFactory _factory;
|
|
|
|
public SyncPlayControllerTests(JellyfinApplicationFactory factory)
|
|
{
|
|
_factory = factory;
|
|
}
|
|
|
|
[Fact]
|
|
public async Task GetGroups_Unauthorized_ReturnsUnauthorized()
|
|
{
|
|
var client = _factory.CreateClient();
|
|
|
|
var response = await client.GetAsync("/SyncPlay/List", TestContext.Current.CancellationToken);
|
|
|
|
Assert.Equal(HttpStatusCode.Unauthorized, response.StatusCode);
|
|
}
|
|
|
|
[Fact]
|
|
public async Task GetGroups_InvalidToken_ReturnsUnauthorized()
|
|
{
|
|
var client = _factory.CreateClient();
|
|
client.DefaultRequestHeaders.AddAuthHeader("invalid-token");
|
|
|
|
var response = await client.GetAsync("/SyncPlay/List", TestContext.Current.CancellationToken);
|
|
|
|
Assert.Equal(HttpStatusCode.Unauthorized, response.StatusCode);
|
|
}
|
|
}
|