test(bff): /health returns 200 Healthy (refs #28)
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>
This commit is contained in:
20
services/bff/Bff.Tests/HealthEndpointTests.cs
Normal file
20
services/bff/Bff.Tests/HealthEndpointTests.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user