using System.Net;

namespace Baya.Test.Api;

/// <summary>
/// refinement-phase-9 §9.2: liveness is split from readiness. <c>/healthz/live</c> reports only the process
/// (dependency-free) so a dependency outage never triggers a restart loop; it must answer healthy even in the
/// test host, whose readiness dependencies (a real SQL Server) are absent.
/// </summary>
public class HealthCheckApiTests(BayaApiFactory factory) : IClassFixture<BayaApiFactory>
{
    [Fact]
    public async Task Liveness_IsHealthy_WithoutTouchingDependencies()
    {
        var client = factory.CreateClient();

        var response = await client.GetAsync("/healthz/live");

        Assert.Equal(HttpStatusCode.OK, response.StatusCode);
    }
}
