using Shouldly;
using Xunit;
using ZB.MOM.WW.OtOpcUa.Commons.Protos;
using ZB.MOM.WW.OtOpcUa.Commons.Protos.Telemetry.V1;
namespace ZB.MOM.WW.OtOpcUa.Commons.Tests;
///
/// Contract-lock for the Phase 5 telemetry oneof. If a fifth variant is added to
/// telemetry.proto without adding a matching entry to
/// , this test goes red — the single guard that
/// keeps the wire contract and the handled-case set from silently drifting apart.
///
public class TelemetryProtoContractTests
{
[Fact]
public void EveryOneofVariant_IsAccountedFor()
{
var variants = System.Enum.GetValues()
.Where(c => c != TelemetryEvent.EventOneofCase.None).ToArray();
variants.ShouldBe(TelemetryProtoContract.HandledCases, ignoreOrder: true);
}
[Fact]
public void The_service_base_and_client_types_generate()
{
// Referencing these types is the whole assertion — GrpcServices="Both" must emit both.
typeof(TelemetryStreamService.TelemetryStreamServiceBase).ShouldNotBeNull();
typeof(TelemetryStreamService.TelemetryStreamServiceClient).ShouldNotBeNull();
}
}