using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Shouldly; using Xunit; using ZB.MOM.WW.OtOpcUa.Host.Drivers; namespace ZB.MOM.WW.OtOpcUa.Host.IntegrationTests; /// /// Guards that the resilience-status tracker now HAS a production reader — the exact /// "built-but-never-wired" class of bug the whole arch-review targets (mirrors /// ). AddOtOpcUaDriverFactories (the /// driver-node bootstrap) must register as an /// . A refactor that drops the registration fails this test, not production. /// public sealed class ResilienceStatusReaderRegistrationTests { [Fact] public void AddOtOpcUaDriverFactories_registers_the_resilience_status_reader_hosted_service() { var services = new ServiceCollection(); services.AddLogging(); services.AddOtOpcUaDriverFactories(); services.ShouldContain( d => d.ServiceType == typeof(IHostedService) && d.ImplementationType == typeof(DriverResilienceStatusPublisherService), "the resilience-status tracker must have a production reader — the periodic DPS publisher hosted service on driver nodes"); } }