Files
tiku-backend.net/Tiku.IntegrationTests/Api/OpenApiDocumentationTests.cs
2026-07-26 14:02:04 +08:00

22 lines
781 B
C#

using System.Net;
using System.Text.Json;
namespace Tiku.IntegrationTests.Api;
public sealed class OpenApiDocumentationTests
{
[Fact]
public async Task Openapi_document_can_be_generated_with_key_paths()
{
await using var factory = new ApiTestFactory();
using var client = factory.CreateClient();
using var response = await client.GetAsync("/openapi/v1.json");
var document = JsonDocument.Parse(await response.Content.ReadAsStringAsync());
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
Assert.True(document.RootElement.GetProperty("paths").TryGetProperty("/api/auth/login/password", out _));
Assert.True(document.RootElement.GetProperty("paths").TryGetProperty("/api/catalog/regions", out _));
}
}