namespace ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.IntegrationTests; /// /// Crosses the PCCC compose profiles with both AbLegacy transports so each integration test runs /// once on libplctag and once on the native managed stack. /// /// /// Preserves the AB_LEGACY_COMPOSE_PROFILE filter the smoke theory always applied: when set, /// is narrowed to that profile before it is crossed with the /// transports, so the rows match the running container. Unset, every family is crossed because each /// has its own port and skips itself when unreachable — unless AB_LEGACY_ENDPOINT pins /// one device, in which case the family is a property of that device and cannot be detected, so only /// the default SLC500 profile is crossed (set AB_LEGACY_COMPOSE_PROFILE to pick another). /// public static class TransportMatrix { /// Both transports, for tests that are not parameterised by profile. public static IReadOnlyList AllTransports { get; } = [AbLegacyTransport.Libplctag, AbLegacyTransport.Native]; /// Gets (profile, transport) rows for every selected profile × both transports. public static IEnumerable Profiles { get { var only = Environment.GetEnvironmentVariable("AB_LEGACY_COMPOSE_PROFILE"); if (string.IsNullOrEmpty(only) && Environment.GetEnvironmentVariable("AB_LEGACY_ENDPOINT") is { Length: > 0 }) only = KnownProfiles.Slc500.ComposeProfile; return from p in KnownProfiles.All where string.IsNullOrEmpty(only) || string.Equals(p.ComposeProfile, only, StringComparison.OrdinalIgnoreCase) from t in AllTransports select new object[] { p, t }; } } /// Gets one row per transport. public static IEnumerable Transports => AllTransports.Select(t => new object[] { t }); }