namespace ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests;
///
/// Tests for StoreAndForwardOptions defaults and configuration.
///
public class StoreAndForwardOptionsTests
{
/// Verifies that the default options have reasonable values.
[Fact]
public void DefaultOptions_HasReasonableDefaults()
{
var options = new StoreAndForwardOptions();
Assert.Equal("./data/store-and-forward.db", options.SqliteDbPath);
Assert.Equal(TimeSpan.FromSeconds(30), options.DefaultRetryInterval);
Assert.Equal(50, options.DefaultMaxRetries);
Assert.Equal(TimeSpan.FromSeconds(10), options.RetryTimerInterval);
}
/// Verifies that the options can be customized.
[Fact]
public void Options_CanBeCustomized()
{
var options = new StoreAndForwardOptions
{
SqliteDbPath = "/custom/path.db",
DefaultRetryInterval = TimeSpan.FromMinutes(5),
DefaultMaxRetries = 100,
RetryTimerInterval = TimeSpan.FromSeconds(30)
};
Assert.Equal("/custom/path.db", options.SqliteDbPath);
Assert.Equal(TimeSpan.FromMinutes(5), options.DefaultRetryInterval);
Assert.Equal(100, options.DefaultMaxRetries);
}
/// Verifies that the sweep batch limit defaults to 500.
[Fact]
public void SweepBatchLimit_Defaults_To_500() =>
Assert.Equal(500, new StoreAndForwardOptions().SweepBatchLimit);
}