Add ApiFactory test helper + /health sanity test
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using System.Net;
|
||||
using FluentAssertions;
|
||||
using Xunit;
|
||||
|
||||
namespace backend.tests;
|
||||
|
||||
public class HealthTests(ApiFactory factory) : IClassFixture<ApiFactory>
|
||||
{
|
||||
private readonly ApiFactory _factory = factory;
|
||||
|
||||
[Fact]
|
||||
public async Task Health_returns_ok()
|
||||
{
|
||||
var client = _factory.CreateClient();
|
||||
var res = await client.GetAsync("/health");
|
||||
res.StatusCode.Should().Be(HttpStatusCode.OK);
|
||||
(await res.Content.ReadAsStringAsync()).Should().Contain("\"ok\":true");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user