Enhance channel and settings functionalities: introduce viewer settings in ChannelEndpoints, update SiteSettings to include channel number toggling, and refactor related data structures. Implement new endpoints for validating templates and diffing scheduling changes, improving overall user experience and configuration management.
This commit is contained in:
@@ -55,6 +55,39 @@ public class ChannelTests
|
||||
Assert.Equal(BumperSelection.AlwaysFirst, channel.BumperSelection);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(-1.0, 2.0, 0.0, 1.0)]
|
||||
[InlineData(0.4, 0.25, 0.4, 0.25)]
|
||||
public void UpdateViewerSettings_ClampsStrengths(
|
||||
double opacity,
|
||||
double filter,
|
||||
double expectedOpacity,
|
||||
double expectedFilter
|
||||
)
|
||||
{
|
||||
var channel = NewChannel();
|
||||
var logo = Guid.NewGuid();
|
||||
|
||||
channel.UpdateViewerSettings(logo, LogoCorner.BottomRight, opacity, true, filter);
|
||||
|
||||
Assert.Equal(logo, channel.LogoImageId);
|
||||
Assert.Equal(LogoCorner.BottomRight, channel.LogoCorner);
|
||||
Assert.Equal(expectedOpacity, channel.LogoOpacity);
|
||||
Assert.True(channel.ShowClock);
|
||||
Assert.Equal(expectedFilter, channel.AnalogFilterStrength);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NewChannel_HasViewerOverlaysOff()
|
||||
{
|
||||
// Канал без логотипа, часов и шума — законная конфигурация, а не недонастроенная.
|
||||
var channel = NewChannel();
|
||||
|
||||
Assert.Null(channel.LogoImageId);
|
||||
Assert.False(channel.ShowClock);
|
||||
Assert.Equal(0.0, channel.AnalogFilterStrength);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AddBumperTemplate_AppendsWithNextPosition()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user