using System.Net; using Microsoft.AspNetCore.Mvc.Testing; using Xunit; using FluentAssertions; namespace AiDevProject.Tests.Unit; /// /// Tests for health controller. /// public class HealthControllerTests : IClassFixture> { private readonly HttpClient _client; public HealthControllerTests(WebApplicationFactory factory) { _client = factory.CreateClient(); } [Fact] public async Task GetHealth_ReturnsOk() { // Act var response = await _client.GetAsync("/api/health"); // Assert response.StatusCode.Should().Be(HttpStatusCode.OK); var content = await response.Content.ReadAsStringAsync(); content.Should().Contain("ok"); } }