using Grpc.Core;
using Mishima.Nexus.Wire.V1;
namespace Robotico.Nexus.Client.Tests.TestSupport;
/// In-memory fake standing in for NexusHealthService.
public sealed class FakeHealthService : NexusHealthService.NexusHealthServiceBase
{
/// When , reports the server as not ready.
public bool Ready { get; set; } = true;
///
public override Task Check(HealthCheckRequest request, ServerCallContext context)
{
HealthCheckResponse response = new() { Ready = Ready };
response.Planes.Add(new EnginePlaneHealth { Plane = "graph", Ready = Ready, Detail = Ready ? "ok" : "simulated down" });
return Task.FromResult(response);
}
}