19 lines
780 B
C#
19 lines
780 B
C#
|
|
using Grpc.Core;
|
||
|
|
using Mishima.Nexus.Wire.V1;
|
||
|
|
|
||
|
|
namespace Robotico.Nexus.Client.Tests.TestSupport;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// In-memory fake standing in for a real Nexus relational engine host — only <c>Ping</c>, the sole
|
||
|
|
/// RPC used by <see cref="Robotico.Nexus.Client.Relational.NexusRelationalClient"/>.
|
||
|
|
/// </summary>
|
||
|
|
public sealed class FakeRelationalEngineService : NexusRelationalEngineService.NexusRelationalEngineServiceBase
|
||
|
|
{
|
||
|
|
/// <inheritdoc />
|
||
|
|
public override Task<RelationalPingResponse> Ping(RelationalPingRequest request, ServerCallContext context)
|
||
|
|
{
|
||
|
|
NexusStatus? failure = FakeNexusTriggers.TryStatusFailure(context);
|
||
|
|
return Task.FromResult(new RelationalPingResponse { Status = failure ?? NexusStatuses.Ok, EngineVersion = "fake" });
|
||
|
|
}
|
||
|
|
}
|