using Shouldly; using Xunit; namespace ZB.MOM.WW.OtOpcUa.Driver.Galaxy.ParityTests; /// /// Shape tests for the itself — these run regardless of /// dev-environment availability. The scenario tests in PR 5.2–5.8 carry the actual /// parity assertions and are guarded by . /// [Collection(nameof(ParityCollection))] public sealed class HarnessShapeTests { private readonly ParityHarness _h; public HarnessShapeTests(ParityHarness h) => _h = h; [Fact] public void Harness_records_a_skip_reason_for_each_unavailable_backend() { // Either the backend resolved (driver != null, skipReason == null) or it didn't // (driver == null, skipReason populated). Asserting the invariant lets the parity // matrix doc (PR 5.W) faithfully report "n/a, reason: ..." for unreachable rigs. (_h.LegacyDriver is null).ShouldBe(_h.LegacySkipReason is not null); (_h.MxGatewayDriver is null).ShouldBe(_h.MxGatewaySkipReason is not null); } [Fact] public async Task RunOnAvailableAsync_yields_one_entry_per_resolved_backend() { var calls = await _h.RunOnAvailableAsync( (_, _) => Task.FromResult(1), CancellationToken.None); var expected = (_h.LegacyDriver is null ? 0 : 1) + (_h.MxGatewayDriver is null ? 0 : 1); calls.Count.ShouldBe(expected); } }