using Shouldly;
using Xunit;
using ZB.MOM.WW.OtOpcUa.Driver.AbCip.Cli.Commands;
namespace ZB.MOM.WW.OtOpcUa.Driver.AbCip.Cli.Tests;
///
/// Covers — the guard that
/// stops a zero / negative --interval-ms from reaching SubscribeAsync
/// as a non-positive .
///
[Trait("Category", "Unit")]
public sealed class SubscribeCommandIntervalTests
{
[Theory]
[InlineData(0)]
[InlineData(-1)]
[InlineData(-500)]
public void ValidateInterval_rejects_non_positive(int badMs)
{
var ex = Should.Throw(
() => SubscribeCommand.ValidateInterval(badMs));
ex.Message.ShouldContain("--interval-ms");
}
[Theory]
[InlineData(1)]
[InlineData(250)]
[InlineData(60_000)]
public void ValidateInterval_accepts_positive(int goodMs)
{
Should.NotThrow(() => SubscribeCommand.ValidateInterval(goodMs));
}
}