Add interstitial endpoints and enhance media and template functionalities: implement MapInterstitialEndpoints in Program.cs, add preview functionality for media assets in MediaEndpoints, and introduce template preview capabilities in TemplateEndpoints. Remove obsolete bumper settings from Channel and related classes to streamline configuration.
This commit is contained in:
@@ -20,9 +20,7 @@ public class ChannelTests
|
||||
Assert.True(channel.IsEnabled);
|
||||
Assert.Equal(Epoch, channel.EpochUtc);
|
||||
Assert.False(channel.BumpersEnabled);
|
||||
Assert.Equal(BumperSelection.Rotation, channel.BumperSelection);
|
||||
Assert.Equal(1.0, channel.BumperShowChangeChance);
|
||||
Assert.Equal(1.0, channel.BumperEpisodeChangeChance);
|
||||
Assert.Equal(BumperSelection.WeightedRandom, channel.BumperSelection);
|
||||
Assert.Equal(Channel.DefaultUtcOffsetMinutes, channel.UtcOffsetMinutes);
|
||||
Assert.Equal(Channel.DefaultDayStartTime, channel.DayStartTime);
|
||||
|
||||
@@ -46,32 +44,15 @@ public class ChannelTests
|
||||
Assert.Equal(filler, channel.FillerAssetId);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(-1, 2.0, -5.0, 1.0, 0.0)]
|
||||
[InlineData(30, 0.3, 0.9, 0.3, 0.9)]
|
||||
public void UpdateBumperSettings_ClampsChancesAndInterval(
|
||||
int interval,
|
||||
double show,
|
||||
double episode,
|
||||
double expectedShow,
|
||||
double expectedEpisode
|
||||
)
|
||||
[Fact]
|
||||
public void UpdateBumperSettings_ChangesFontAndSelection()
|
||||
{
|
||||
var channel = NewChannel();
|
||||
|
||||
channel.UpdateBumperSettings(
|
||||
BumperFont.Serif,
|
||||
interval,
|
||||
BumperSelection.WeightedRandom,
|
||||
show,
|
||||
episode
|
||||
);
|
||||
channel.UpdateBumperSettings(BumperFont.Serif, BumperSelection.AlwaysFirst);
|
||||
|
||||
Assert.Equal(BumperFont.Serif, channel.BumperFont);
|
||||
Assert.Equal(Math.Max(0, interval), channel.BumperMinIntervalMinutes);
|
||||
Assert.Equal(BumperSelection.WeightedRandom, channel.BumperSelection);
|
||||
Assert.Equal(expectedShow, channel.BumperShowChangeChance);
|
||||
Assert.Equal(expectedEpisode, channel.BumperEpisodeChangeChance);
|
||||
Assert.Equal(BumperSelection.AlwaysFirst, channel.BumperSelection);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user