playout builder bugfixes

This commit is contained in:
Jason Dove
2021-02-10 07:43:18 -06:00
parent 32f4bfcf08
commit 0e262f227d
13 changed files with 156 additions and 185 deletions
@@ -59,26 +59,6 @@ namespace ErsatzTV.Core.Tests.Scheduling
}
}
[Test]
public void Peek_Should_Not_Impact_Current_Or_Wrapping()
{
List<MediaItem> contents = Episodes(10);
var state = new MediaCollectionEnumeratorState();
var chronologicalContent = new ChronologicalMediaCollectionEnumerator(contents, state);
for (var i = 0; i < 100; i++)
{
chronologicalContent.Current.IsSome.Should().BeTrue();
chronologicalContent.Current.Map(x => x.Id).IfNone(-1).Should().Be(i % 10 + 1);
chronologicalContent.Peek.Map(x => x.Id).IfNone(-1).Should().Be((i + 1) % 10 + 1);
chronologicalContent.Peek.Map(x => x.Id).IfNone(-1).Should().Be((i + 1) % 10 + 1);
chronologicalContent.MoveNext();
}
}
private static List<MediaItem> Episodes(int count) =>
Range(1, count).Map(
i => new MediaItem