test(backend): add xUnit tests for the API skeleton
Add tests/TarninaHub.Tests with health controller and SurrealDB endpoint builder tests, and register the test and layer projects in the solution.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using TarninaHub.Controllers;
|
||||
|
||||
namespace TarninaHub.Tests.Controllers;
|
||||
|
||||
public class HealthControllerTests
|
||||
{
|
||||
[Fact]
|
||||
public void Get_ReturnsOkWithHealthyStatus()
|
||||
{
|
||||
var controller = new HealthController();
|
||||
|
||||
var result = controller.Get();
|
||||
|
||||
var ok = Assert.IsType<OkObjectResult>(result.Result);
|
||||
var payload = Assert.IsType<HealthResponse>(ok.Value);
|
||||
Assert.Equal("ok", payload.Status);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user