fix stuck playout builds (#235)

* fix stuck playout builds

* code cleanup
This commit is contained in:
Jason Dove
2021-05-31 06:38:54 -05:00
committed by GitHub
parent 539285d81e
commit 9f575dbd94
6 changed files with 53 additions and 2 deletions
@@ -60,6 +60,19 @@ namespace ErsatzTV.Core.Tests.Scheduling
}
}
[Test]
[Timeout(1000)]
public void State_Should_Reset_When_Invalid()
{
List<MediaItem> contents = Episodes(10);
var state = new CollectionEnumeratorState { Index = 10 };
var chronologicalContent = new ChronologicalMediaCollectionEnumerator(contents, state);
chronologicalContent.State.Index.Should().Be(0);
chronologicalContent.State.Seed.Should().Be(0);
}
private static List<MediaItem> Episodes(int count) =>
Range(1, count).Map(
i => (MediaItem) new Episode