using ZB.MOM.WW.ScadaBridge.CLI.Commands; namespace ZB.MOM.WW.ScadaBridge.CLI.Tests.Commands; /// /// #257: --trigger-kind is written into the trigger-config JSON by /// , which /// returns null (dropping the kind) when no --trigger-config is supplied. Passing /// --trigger-kind without --trigger-config was therefore a silent no-op. /// The CLI now detects that combination () /// and warns the user (warn-and-continue, not a hard error). These tests pin the predicate. /// public class TemplateTriggerKindIgnoredTests { [Fact] public void KindWithoutConfig_WillBeIgnored() { Assert.True(TemplateCommands.TriggerKindWillBeIgnored(triggerConfig: null, triggerKind: "strict")); } [Fact] public void KindWithBlankConfig_WillBeIgnored() { Assert.True(TemplateCommands.TriggerKindWillBeIgnored(triggerConfig: " ", triggerKind: "strict")); } [Fact] public void KindWithConfig_NotIgnored() { Assert.False(TemplateCommands.TriggerKindWillBeIgnored( triggerConfig: "{\"expression\":\"x > 0\"}", triggerKind: "strict")); } [Fact] public void NoKind_NotIgnored() { // No --trigger-kind at all → nothing to warn about, even without a config. Assert.False(TemplateCommands.TriggerKindWillBeIgnored(triggerConfig: null, triggerKind: null)); Assert.False(TemplateCommands.TriggerKindWillBeIgnored(triggerConfig: null, triggerKind: " ")); } [Fact] public void NoKindWithConfig_NotIgnored() { Assert.False(TemplateCommands.TriggerKindWillBeIgnored( triggerConfig: "{\"expression\":\"x > 0\"}", triggerKind: null)); } }