Add the BFF Api/Tests skeleton (.NET 10, ASP.NET Core minimal API, xUnit + WebApplicationFactory) and a failing test asserting GET /health returns 200 with a Healthy body. The endpoint does not exist yet — the test fails with NotFound, establishing red before the implementation. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
21 lines
576 B
C#
21 lines
576 B
C#
using System.Net;
|
|
using Microsoft.AspNetCore.Mvc.Testing;
|
|
|
|
namespace Bff.Tests;
|
|
|
|
public class HealthEndpointTests(WebApplicationFactory<Program> factory)
|
|
: IClassFixture<WebApplicationFactory<Program>>
|
|
{
|
|
[Fact]
|
|
public async Task Health_endpoint_returns_200_and_reports_healthy()
|
|
{
|
|
var client = factory.CreateClient();
|
|
|
|
var response = await client.GetAsync("/health");
|
|
|
|
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
|
var body = await response.Content.ReadAsStringAsync();
|
|
Assert.Contains("Healthy", body);
|
|
}
|
|
}
|