Files
TeleWave/backend/tests/TeleWave.Application.Tests/Support/GroupServices.cs
T
Leonid Pershin 926a20020f
ci / build-backend (push) Successful in 1m18s
ci / build-frontend (push) Successful in 43s
ci / tests (push) Successful in 3m38s
ci / sonar (push) Successful in 3m38s
Add InterstitialGroups service and enhance SlotWriter and related components for interstitial handling
Introduced the InterstitialGroups service to manage interstitial group logic, preventing their inclusion in slots and fallback groups. Updated the SlotWriter class to utilize this service, ensuring proper validation during slot creation and updates. Enhanced error handling for interstitial groups in the ImportGridCommandHandler and UpdateTemplateCommandHandler, providing warnings instead of failures when interstitials are detected. Updated related tests to verify the correct behavior of these changes, ensuring robust handling of interstitials in the scheduling process.
2026-07-30 12:48:51 +03:00

24 lines
1.1 KiB
C#

using TeleWave.Application.Common.Interfaces;
using TeleWave.Application.Programming.Groups;
using TeleWave.Application.Programming.Templates;
namespace TeleWave.Application.Tests.Support;
/// <summary>
/// Сборка сервисов группы для тестов: их четыре и они цепляются друг за друга, а в тестах нужен
/// каждый раз один и тот же набор. В приложении это делает контейнер.
/// </summary>
internal static class GroupServices
{
public static DynamicGroupResolver Dynamic(IAppDbContext db) =>
new(new GroupFilterMatcher(db), new GroupElementResolver(db));
public static GroupStatsService Stats(IAppDbContext db) =>
new(db, new GroupElementResolver(db), Dynamic(db));
/// <summary>Писатель слотов: ему нужен ещё и признак «группа роликов» — их в слот не пускают.</summary>
public static InterstitialGroups Interstitials(IAppDbContext db) => new(db);
public static SlotWriter Slots(IAppDbContext db) => new(db, Interstitials(db));
}