From b3bc3ed115edaedae5e93013c8f948e00855f1ed Mon Sep 17 00:00:00 2001 From: Timothy Date: Sat, 5 Sep 2026 05:11:37 +0200 Subject: [PATCH] test(563): pin per-item guide-group advancement, which mutant b showed was unmeasured Removing SchedulingEngine.AddCountInternal's _state.AdvanceGuideGroup() left both guide-group assertions green: the locked-group test only compared inside/outside the group, and the snapshot only compared item 2 to item 0. Assert the actual sequence instead. Refs #563 Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_015QqCpYFsKgnAnx6jVwrKiV --- .../Scheduling/Engine/SchedulingEngineTests.cs | 6 +++++- .../Controllers/ScriptedScheduleControllerTests.cs | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ErsatzTV.Core.Tests/Scheduling/Engine/SchedulingEngineTests.cs b/ErsatzTV.Core.Tests/Scheduling/Engine/SchedulingEngineTests.cs index b3d04fe12..6a892aa40 100644 --- a/ErsatzTV.Core.Tests/Scheduling/Engine/SchedulingEngineTests.cs +++ b/ErsatzTV.Core.Tests/Scheduling/Engine/SchedulingEngineTests.cs @@ -87,6 +87,9 @@ public class SchedulingEngineTests item.PlayoutId.ShouldBe(1); } + // outside an EPG group every item opens its own guide group + items.Select(i => i.GuideGroup).ShouldBe([1, 2, 3, 4]); + // 30 + 45 + 60 + 20 minutes of content TimeSpan scheduled = TimeSpan.FromMinutes(155); items[^1].Finish.ShouldBe(Start.UtcDateTime + scheduled); @@ -350,7 +353,8 @@ public class SchedulingEngineTests grouped.Select(i => i.GuideGroup).Distinct().Count().ShouldBe(1); grouped.ShouldAllBe(i => i.CustomTitle == "Block"); - items[3].GuideGroup.ShouldNotBe(grouped[0].GuideGroup); + // unlocking resumes per-item advancement from the group's number + items[3].GuideGroup.ShouldBe(grouped[0].GuideGroup + 1); items[3].CustomTitle.ShouldBeNull(); } diff --git a/ErsatzTV.Tests/Controllers/ScriptedScheduleControllerTests.cs b/ErsatzTV.Tests/Controllers/ScriptedScheduleControllerTests.cs index dcc3c4e52..8ec704b54 100644 --- a/ErsatzTV.Tests/Controllers/ScriptedScheduleControllerTests.cs +++ b/ErsatzTV.Tests/Controllers/ScriptedScheduleControllerTests.cs @@ -106,6 +106,9 @@ public class ScriptedScheduleControllerTests items[1].CustomTitle.ShouldBe("Morning Block"); items[2].CustomTitle.ShouldBeNull(); + // after stop_epg_group every item opens its own guide group again + items.Skip(2).Select(i => i.GuideGroup).ShouldBe(Enumerable.Range(2, 11)); + // pad_until_exact lands on the requested instant, whatever the machine offset is items[6].Finish.ShouldBe(new DateTime(2026, 1, 15, 10, 0, 0, DateTimeKind.Utc)); }