Files
tiku-backend.net/Tiku.IntegrationTests/Api/PlatformAdminFrontendSeparationTests.cs
xiong c497a3ca8d
Some checks failed
ci / release-gate (push) Has been cancelled
清理代码
2026-08-03 12:31:39 +08:00

24 lines
733 B
C#

using System.Net;
using Microsoft.AspNetCore.Mvc.Testing;
namespace Tiku.IntegrationTests.Api;
public sealed class PlatformAdminFrontendSeparationTests
{
[Theory]
[InlineData("/platform-admin")]
[InlineData("/platform-admin/")]
[InlineData("/platform-admin/app.js")]
public async Task Unauthenticated_platform_admin_paths_use_the_api_fallback_policy(string path)
{
await using var factory = new ApiTestFactory();
using var client = factory.CreateClient(new WebApplicationFactoryClientOptions
{
AllowAutoRedirect = false
});
using var response = await client.GetAsync(path);
Assert.Equal(HttpStatusCode.Unauthorized, response.StatusCode);
}
}