@ -863,5 +863,53 @@ public static class AlternateScheduleSelectorTests
@@ -863,5 +863,53 @@ public static class AlternateScheduleSelectorTests
result . IsNone . ShouldBeFalse ( ) ;
}
[Test]
public void LimitToDateRange_13th_Month_Should_Not_Crash ( )
{
var template = new PlayoutTemplate
{
DaysOfWeek = AlternateScheduleSelector . AllDaysOfWeek ( ) ,
DaysOfMonth = AlternateScheduleSelector . AllDaysOfMonth ( ) ,
MonthsOfYear = AlternateScheduleSelector . AllMonthsOfYear ( ) ,
LimitToDateRange = true ,
StartMonth = 1 3 ,
StartDay = 3 0 ,
StartYear = 2 0 2 2 ,
EndMonth = 1 3 ,
EndDay = 3 0 ,
EndYear = 2 0 2 3
} ;
Option < PlayoutTemplate > result = AlternateScheduleSelector . GetScheduleForDate (
new List < PlayoutTemplate > { template } ,
new DateTimeOffset ( 2 0 2 3 , 3 , 1 , 0 , 0 , 0 , Offset ) ) ;
result . IsNone . ShouldBeTrue ( ) ;
}
[Test]
public void LimitToDateRange_0th_Day_Should_Not_Crash ( )
{
var template = new PlayoutTemplate
{
DaysOfWeek = AlternateScheduleSelector . AllDaysOfWeek ( ) ,
DaysOfMonth = AlternateScheduleSelector . AllDaysOfMonth ( ) ,
MonthsOfYear = AlternateScheduleSelector . AllMonthsOfYear ( ) ,
LimitToDateRange = true ,
StartMonth = 1 2 ,
StartDay = 0 ,
StartYear = 2 0 2 2 ,
EndMonth = 1 2 ,
EndDay = 0 ,
EndYear = 2 0 2 3
} ;
Option < PlayoutTemplate > result = AlternateScheduleSelector . GetScheduleForDate (
new List < PlayoutTemplate > { template } ,
new DateTimeOffset ( 2 0 2 3 , 3 , 1 , 0 , 0 , 0 , Offset ) ) ;
result . IsNone . ShouldBeTrue ( ) ;
}
}
}