Enhance GroupFilterMatcher to handle interstitial shows and update related tests and documentation
Updated the GroupFilterMatcher to exclude interstitial shows by default unless explicitly specified in the filter. Added new tests to verify the behavior of the filter with and without interstitial shows. Updated localization strings to clarify the handling of show types in the user interface and documentation, ensuring users understand the distinction between films, series, and clips.
This commit is contained in:
@@ -26,6 +26,40 @@ public class GroupFilterMatcherTests
|
||||
Assert.Equal([(GroupElementKind.Show, movie.Id)], matched);
|
||||
}
|
||||
|
||||
/// <summary>Группа рекламы собирается тем же правилом — иначе её нечем набрать, кроме как руками.</summary>
|
||||
[Fact]
|
||||
public async Task ShowKinds_Interstitial_SelectsClips()
|
||||
{
|
||||
var fixture = new TestDb();
|
||||
var movie = Show.Create("Фильм", ShowKind.Single);
|
||||
var clip = Show.Create("Ролик", ShowKind.Interstitial);
|
||||
await SeedAsync(fixture, movie, clip);
|
||||
|
||||
var matched = await MatchAsync(
|
||||
fixture,
|
||||
new GroupFilter(ShowKinds: [ShowKind.Interstitial])
|
||||
);
|
||||
|
||||
Assert.Equal([(GroupElementKind.Show, clip.Id)], matched);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Без указанного типа правило означает «кино и сериалы»: ролики живут отдельной библиотекой,
|
||||
/// и сотня рекламных вставок в группе фильмов — это не «широкий отбор», а сломанный эфир.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task ShowKinds_Empty_LeavesOutClips()
|
||||
{
|
||||
var fixture = new TestDb();
|
||||
var movie = Show.Create("Фильм", ShowKind.Single);
|
||||
var clip = Show.Create("Ролик", ShowKind.Interstitial);
|
||||
await SeedAsync(fixture, movie, clip);
|
||||
|
||||
var matched = await MatchAsync(fixture, new GroupFilter());
|
||||
|
||||
Assert.Equal([(GroupElementKind.Show, movie.Id)], matched);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task MaxAudience_KeepsUnrated()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user