using System.Net; using System.Net.Http.Json; using Microsoft.AspNetCore.Mvc.Testing; namespace MeetingAssistant.Tests; public sealed class HealthEndpointTests : IClassFixture> { private readonly WebApplicationFactory factory; public HealthEndpointTests(WebApplicationFactory factory) { this.factory = factory; } [Fact] public async Task HealthEndpointReportsServiceStatus() { using var client = factory.CreateClient(); using var response = await client.GetAsync("/health"); var body = await response.Content.ReadFromJsonAsync(); Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.Equal("meeting-assistant", body?.Service); Assert.Equal("ok", body?.Status); } private sealed record HealthResponse(string Service, string Status); }