mirror of https://github.com/ErsatzTV/ErsatzTV.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.0 KiB
35 lines
1.0 KiB
using ErsatzTV.Core.Domain; |
|
using ErsatzTV.Core.Interfaces.Repositories; |
|
using ErsatzTV.Core.Scheduling.Engine; |
|
using Microsoft.Extensions.Logging; |
|
using NSubstitute; |
|
using NUnit.Framework; |
|
|
|
namespace ErsatzTV.Core.Tests.Scheduling.Engine; |
|
|
|
[TestFixture] |
|
public class SchedulingEngineTests |
|
{ |
|
[Test] |
|
public void Continue_Across_Time_Change() |
|
{ |
|
var engine = new SchedulingEngine( |
|
Substitute.For<IMediaCollectionRepository>(), |
|
Substitute.For<IGraphicsElementRepository>(), |
|
Substitute.For<IChannelRepository>(), |
|
Substitute.For<ILogger<SchedulingEngine>>()); |
|
|
|
var anchor = new PlayoutAnchor |
|
{ |
|
NextStart = new DateTimeOffset(new DateTime(2025, 10, 26), TimeSpan.FromHours(-5)).UtcDateTime |
|
}; |
|
|
|
var start = new DateTimeOffset(new DateTime(2025, 11, 20), TimeSpan.FromHours(-6)); |
|
var finish = start.AddDays(1); |
|
|
|
engine.BuildBetween(start, finish); |
|
|
|
// should not throw |
|
engine.RestoreOrReset(anchor); |
|
} |
|
}
|
|
|