513fa1aa16
Comment/XML-doc changes only: - add summaries to ~10k test methods, fixtures, fakes and helpers (+ <param> on theories, <returns> on async Task methods, <inheritdoc/> on interface implementations the checker can resolve) - strip ~2.6k project-tracking references (WP*, P*-*, row-NN, Task N, #NN, Component-0NN) from comments, keeping the explanatory text; reword false positives in comments only - real docs on fakes implementing BCL/library interfaces (IDisposable, ILogger, IOptionsMonitor, IAsyncLifetime) - reword the last 5 src/ false positives (CWE-1236, failures-1, year-0001, M365) Only non-comment edits: four one-line nested classes split across lines so members can carry docs. Build 0 errors / 0 warnings.
35 lines
1.3 KiB
C#
35 lines
1.3 KiB
C#
using System.Net;
|
|
|
|
namespace ZB.MOM.WW.ScadaBridge.IntegrationTests;
|
|
|
|
/// <summary>
|
|
/// Readiness gating — /health/ready endpoint returns status code.
|
|
/// </summary>
|
|
public class ReadinessTests : IClassFixture<ScadaBridgeWebApplicationFactory>
|
|
{
|
|
private readonly ScadaBridgeWebApplicationFactory _factory;
|
|
|
|
/// <summary>Initializes the test class with the web application factory.</summary>
|
|
/// <param name="factory">The factory.</param>
|
|
public ReadinessTests(ScadaBridgeWebApplicationFactory factory)
|
|
{
|
|
_factory = factory;
|
|
}
|
|
|
|
/// <summary>Verifies that the health ready endpoint returns a success status code.</summary>
|
|
/// <returns>A task that represents the asynchronous operation.</returns>
|
|
[Fact]
|
|
public async Task HealthReady_ReturnsSuccessStatusCode()
|
|
{
|
|
using var client = _factory.CreateClient();
|
|
|
|
var response = await client.GetAsync("/health/ready");
|
|
|
|
// The endpoint should exist and return 200 OK (or 503 if not ready yet).
|
|
// For now, just verify the endpoint exists and returns a valid HTTP response.
|
|
Assert.True(
|
|
response.StatusCode == HttpStatusCode.OK || response.StatusCode == HttpStatusCode.ServiceUnavailable,
|
|
$"Expected 200 or 503 but got {response.StatusCode}");
|
|
}
|
|
}
|