fix: cap automatic playout refreshes
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user