fix: cap automatic playout refreshes

This commit is contained in:
2026-07-12 19:28:15 +09:00
parent 6e00955f1b
commit df60e09884
16 changed files with 603 additions and 37 deletions

View File

@@ -510,6 +510,35 @@ public sealed class PlayoutSafetyValidationTests : IDisposable
Assert.Contains(expectedProperty, exception.Message, StringComparison.Ordinal);
}
[Theory]
[InlineData(-1)]
[InlineData(1_000_001)]
public void Validate_OutOfRangeAutomaticRefreshMaximumIsRejected(int value)
{
var options = ValidTestOptions();
options.MaximumAutomaticRefreshesPerTakeIn = value;
var exception = Assert.Throws<PlayoutConfigurationException>(
() => ValidatedPlayoutOptions.Create(options));
Assert.Contains(
nameof(PlayoutOptions.MaximumAutomaticRefreshesPerTakeIn),
exception.Message,
StringComparison.Ordinal);
}
[Theory]
[InlineData(0)]
[InlineData(1)]
[InlineData(1_000_000)]
public void Validate_AutomaticRefreshMaximumAcceptsClosedSafeRange(int value)
{
var options = ValidTestOptions();
options.MaximumAutomaticRefreshesPerTakeIn = value;
_ = ValidatedPlayoutOptions.Create(options);
}
public void Dispose() => _scenes.Dispose();
private PlayoutOptions ValidTestOptions() => new()