Выполнениие лабораторной работы на 5, трек 2.
Skeleton contracts / contracts (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using System.Net;
|
||||
|
||||
namespace Messenger.Api.Tests;
|
||||
|
||||
[Collection("api")]
|
||||
public class HealthTests(ApiFixture fixture)
|
||||
{
|
||||
[Fact]
|
||||
public async Task Live_ReturnsOk()
|
||||
{
|
||||
using var client = fixture.CreateClient();
|
||||
|
||||
var response = await client.GetAsync("/health/live");
|
||||
|
||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Ready_ReturnsOkWhenDatabaseIsAvailable()
|
||||
{
|
||||
using var client = fixture.CreateClient();
|
||||
|
||||
var response = await client.GetAsync("/health/ready");
|
||||
|
||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
Assert.True(response.Headers.Contains("X-Request-Id"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user