From b2276b5b046ca92685a3efbe8418e585cb459a00 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Sat, 27 Jun 2026 00:24:12 -0400 Subject: [PATCH] test(historian-gateway): cover AlarmHistorianOptions.Validate MaxAttempts<=0 warning (FU-4) The MaxAttempts<=0 warning branch in AlarmHistorianOptions.Validate() was the only one without a test (the sibling DrainIntervalSeconds/Capacity/ DeadLetterRetentionDays warnings are covered). Add the matching case. Closes FU-4. Claude-Session: https://claude.ai/code/session_012SDSQ3AcaXqPcBtDESBRii --- .../Historian/AlarmHistorianRegistrationTests.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/Historian/AlarmHistorianRegistrationTests.cs b/tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/Historian/AlarmHistorianRegistrationTests.cs index 3421208f..8100f19f 100644 --- a/tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/Historian/AlarmHistorianRegistrationTests.cs +++ b/tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/Historian/AlarmHistorianRegistrationTests.cs @@ -152,6 +152,13 @@ public sealed class AlarmHistorianRegistrationTests opts.Validate().ShouldContain(w => w.Contains("DeadLetterRetentionDays")); } + [Fact] + public void Validate_warns_on_non_positive_max_attempts() + { + var opts = new AlarmHistorianOptions { Enabled = true, DatabasePath = "/abs/h.db", MaxAttempts = 0 }; + opts.Validate().ShouldContain(w => w.Contains("MaxAttempts")); + } + [Fact] public void Validate_accumulates_multiple_warnings() {