|
|
|
@ -34,6 +34,30 @@ public static class AlternateScheduleSelectorTests |
|
|
|
result.IsNone.ShouldBeTrue(); |
|
|
|
result.IsNone.ShouldBeTrue(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
|
|
|
public void LimitToDateRange_Before_Start_With_Year_Should_Not_Return_Template() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var template = new PlayoutTemplate |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DaysOfWeek = AlternateScheduleSelector.AllDaysOfWeek(), |
|
|
|
|
|
|
|
DaysOfMonth = AlternateScheduleSelector.AllDaysOfMonth(), |
|
|
|
|
|
|
|
MonthsOfYear = AlternateScheduleSelector.AllMonthsOfYear(), |
|
|
|
|
|
|
|
LimitToDateRange = true, |
|
|
|
|
|
|
|
StartMonth = 4, |
|
|
|
|
|
|
|
StartDay = 1, |
|
|
|
|
|
|
|
StartYear = 2024, |
|
|
|
|
|
|
|
EndMonth = 6, |
|
|
|
|
|
|
|
EndDay = 15, |
|
|
|
|
|
|
|
EndYear = 2024 |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Option<PlayoutTemplate> result = AlternateScheduleSelector.GetScheduleForDate( |
|
|
|
|
|
|
|
new List<PlayoutTemplate> { template }, |
|
|
|
|
|
|
|
new DateTimeOffset(2024, 3, 31, 0, 0, 0, Offset)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.IsNone.ShouldBeTrue(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
[Test] |
|
|
|
public void LimitToDateRange_On_Start_Should_Return_Template() |
|
|
|
public void LimitToDateRange_On_Start_Should_Return_Template() |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -56,6 +80,30 @@ public static class AlternateScheduleSelectorTests |
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
|
|
|
public void LimitToDateRange_On_Start_With_Year_Should_Return_Template() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var template = new PlayoutTemplate |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DaysOfWeek = AlternateScheduleSelector.AllDaysOfWeek(), |
|
|
|
|
|
|
|
DaysOfMonth = AlternateScheduleSelector.AllDaysOfMonth(), |
|
|
|
|
|
|
|
MonthsOfYear = AlternateScheduleSelector.AllMonthsOfYear(), |
|
|
|
|
|
|
|
LimitToDateRange = true, |
|
|
|
|
|
|
|
StartMonth = 4, |
|
|
|
|
|
|
|
StartDay = 1, |
|
|
|
|
|
|
|
StartYear = 2024, |
|
|
|
|
|
|
|
EndMonth = 6, |
|
|
|
|
|
|
|
EndDay = 15, |
|
|
|
|
|
|
|
EndYear = 2024 |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Option<PlayoutTemplate> result = AlternateScheduleSelector.GetScheduleForDate( |
|
|
|
|
|
|
|
new List<PlayoutTemplate> { template }, |
|
|
|
|
|
|
|
new DateTimeOffset(2024, 4, 1, 0, 0, 0, Offset)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
[Test] |
|
|
|
public void LimitToDateRange_In_Range_Should_Return_Template() |
|
|
|
public void LimitToDateRange_In_Range_Should_Return_Template() |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -78,6 +126,30 @@ public static class AlternateScheduleSelectorTests |
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
|
|
|
public void LimitToDateRange_In_Range_With_Year_Should_Return_Template() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var template = new PlayoutTemplate |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DaysOfWeek = AlternateScheduleSelector.AllDaysOfWeek(), |
|
|
|
|
|
|
|
DaysOfMonth = AlternateScheduleSelector.AllDaysOfMonth(), |
|
|
|
|
|
|
|
MonthsOfYear = AlternateScheduleSelector.AllMonthsOfYear(), |
|
|
|
|
|
|
|
LimitToDateRange = true, |
|
|
|
|
|
|
|
StartMonth = 4, |
|
|
|
|
|
|
|
StartDay = 1, |
|
|
|
|
|
|
|
StartYear = 2024, |
|
|
|
|
|
|
|
EndMonth = 6, |
|
|
|
|
|
|
|
EndDay = 15, |
|
|
|
|
|
|
|
EndYear = 2024 |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Option<PlayoutTemplate> result = AlternateScheduleSelector.GetScheduleForDate( |
|
|
|
|
|
|
|
new List<PlayoutTemplate> { template }, |
|
|
|
|
|
|
|
new DateTimeOffset(2024, 4, 20, 0, 0, 0, Offset)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
[Test] |
|
|
|
public void LimitToDateRange_On_End_Should_Return_Template() |
|
|
|
public void LimitToDateRange_On_End_Should_Return_Template() |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -100,6 +172,30 @@ public static class AlternateScheduleSelectorTests |
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
|
|
|
public void LimitToDateRange_On_End_With_Year_Should_Return_Template() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var template = new PlayoutTemplate |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DaysOfWeek = AlternateScheduleSelector.AllDaysOfWeek(), |
|
|
|
|
|
|
|
DaysOfMonth = AlternateScheduleSelector.AllDaysOfMonth(), |
|
|
|
|
|
|
|
MonthsOfYear = AlternateScheduleSelector.AllMonthsOfYear(), |
|
|
|
|
|
|
|
LimitToDateRange = true, |
|
|
|
|
|
|
|
StartMonth = 4, |
|
|
|
|
|
|
|
StartDay = 1, |
|
|
|
|
|
|
|
StartYear = 2023, |
|
|
|
|
|
|
|
EndMonth = 6, |
|
|
|
|
|
|
|
EndDay = 15, |
|
|
|
|
|
|
|
EndYear = 2024 |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Option<PlayoutTemplate> result = AlternateScheduleSelector.GetScheduleForDate( |
|
|
|
|
|
|
|
new List<PlayoutTemplate> { template }, |
|
|
|
|
|
|
|
new DateTimeOffset(2024, 6, 15, 0, 0, 0, Offset)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
[Test] |
|
|
|
public void LimitToDateRange_After_End_Should_Not_Return_Template() |
|
|
|
public void LimitToDateRange_After_End_Should_Not_Return_Template() |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -122,6 +218,30 @@ public static class AlternateScheduleSelectorTests |
|
|
|
result.IsNone.ShouldBeTrue(); |
|
|
|
result.IsNone.ShouldBeTrue(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
|
|
|
public void LimitToDateRange_After_End_With_Year_Should_Not_Return_Template() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var template = new PlayoutTemplate |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DaysOfWeek = AlternateScheduleSelector.AllDaysOfWeek(), |
|
|
|
|
|
|
|
DaysOfMonth = AlternateScheduleSelector.AllDaysOfMonth(), |
|
|
|
|
|
|
|
MonthsOfYear = AlternateScheduleSelector.AllMonthsOfYear(), |
|
|
|
|
|
|
|
LimitToDateRange = true, |
|
|
|
|
|
|
|
StartMonth = 4, |
|
|
|
|
|
|
|
StartDay = 1, |
|
|
|
|
|
|
|
StartYear = 2024, |
|
|
|
|
|
|
|
EndMonth = 6, |
|
|
|
|
|
|
|
EndDay = 15, |
|
|
|
|
|
|
|
EndYear = 2024 |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Option<PlayoutTemplate> result = AlternateScheduleSelector.GetScheduleForDate( |
|
|
|
|
|
|
|
new List<PlayoutTemplate> { template }, |
|
|
|
|
|
|
|
new DateTimeOffset(2024, 6, 16, 0, 0, 0, Offset)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.IsNone.ShouldBeTrue(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
[Test] |
|
|
|
public void LimitToDateRange_Before_Invalid_Start_Date_Should_Not_Return_Template() |
|
|
|
public void LimitToDateRange_Before_Invalid_Start_Date_Should_Not_Return_Template() |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -144,6 +264,30 @@ public static class AlternateScheduleSelectorTests |
|
|
|
result.IsNone.ShouldBeTrue(); |
|
|
|
result.IsNone.ShouldBeTrue(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
|
|
|
public void LimitToDateRange_Before_Invalid_Start_Date_With_Year_Should_Not_Return_Template() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var template = new PlayoutTemplate |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DaysOfWeek = AlternateScheduleSelector.AllDaysOfWeek(), |
|
|
|
|
|
|
|
DaysOfMonth = AlternateScheduleSelector.AllDaysOfMonth(), |
|
|
|
|
|
|
|
MonthsOfYear = AlternateScheduleSelector.AllMonthsOfYear(), |
|
|
|
|
|
|
|
LimitToDateRange = true, |
|
|
|
|
|
|
|
StartMonth = 2, |
|
|
|
|
|
|
|
StartDay = 29, |
|
|
|
|
|
|
|
StartYear = 2023, |
|
|
|
|
|
|
|
EndMonth = 6, |
|
|
|
|
|
|
|
EndDay = 15, |
|
|
|
|
|
|
|
EndYear = 2023 |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Option<PlayoutTemplate> result = AlternateScheduleSelector.GetScheduleForDate( |
|
|
|
|
|
|
|
new List<PlayoutTemplate> { template }, |
|
|
|
|
|
|
|
new DateTimeOffset(2023, 2, 28, 0, 0, 0, Offset)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.IsNone.ShouldBeTrue(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
[Test] |
|
|
|
public void LimitToDateRange_After_Invalid_Start_Date_Should_Return_Template() |
|
|
|
public void LimitToDateRange_After_Invalid_Start_Date_Should_Return_Template() |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -166,6 +310,30 @@ public static class AlternateScheduleSelectorTests |
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
|
|
|
public void LimitToDateRange_After_Invalid_Start_Date_With_Year_Should_Return_Template() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var template = new PlayoutTemplate |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DaysOfWeek = AlternateScheduleSelector.AllDaysOfWeek(), |
|
|
|
|
|
|
|
DaysOfMonth = AlternateScheduleSelector.AllDaysOfMonth(), |
|
|
|
|
|
|
|
MonthsOfYear = AlternateScheduleSelector.AllMonthsOfYear(), |
|
|
|
|
|
|
|
LimitToDateRange = true, |
|
|
|
|
|
|
|
StartMonth = 2, |
|
|
|
|
|
|
|
StartDay = 29, |
|
|
|
|
|
|
|
StartYear = 2023, |
|
|
|
|
|
|
|
EndMonth = 6, |
|
|
|
|
|
|
|
EndDay = 15, |
|
|
|
|
|
|
|
EndYear = 2023 |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Option<PlayoutTemplate> result = AlternateScheduleSelector.GetScheduleForDate( |
|
|
|
|
|
|
|
new List<PlayoutTemplate> { template }, |
|
|
|
|
|
|
|
new DateTimeOffset(2023, 3, 1, 0, 0, 0, Offset)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
[Test] |
|
|
|
public void LimitToDateRange_Before_Invalid_End_Date_Should_Return_Template() |
|
|
|
public void LimitToDateRange_Before_Invalid_End_Date_Should_Return_Template() |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -188,6 +356,30 @@ public static class AlternateScheduleSelectorTests |
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
|
|
|
public void LimitToDateRange_Before_Invalid_End_Date_With_Year_Should_Return_Template() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var template = new PlayoutTemplate |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DaysOfWeek = AlternateScheduleSelector.AllDaysOfWeek(), |
|
|
|
|
|
|
|
DaysOfMonth = AlternateScheduleSelector.AllDaysOfMonth(), |
|
|
|
|
|
|
|
MonthsOfYear = AlternateScheduleSelector.AllMonthsOfYear(), |
|
|
|
|
|
|
|
LimitToDateRange = true, |
|
|
|
|
|
|
|
StartMonth = 1, |
|
|
|
|
|
|
|
StartDay = 1, |
|
|
|
|
|
|
|
StartYear = 2023, |
|
|
|
|
|
|
|
EndMonth = 2, |
|
|
|
|
|
|
|
EndDay = 29, |
|
|
|
|
|
|
|
EndYear = 2023 |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Option<PlayoutTemplate> result = AlternateScheduleSelector.GetScheduleForDate( |
|
|
|
|
|
|
|
new List<PlayoutTemplate> { template }, |
|
|
|
|
|
|
|
new DateTimeOffset(2023, 2, 28, 0, 0, 0, Offset)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
[Test] |
|
|
|
public void LimitToDateRange_After_Invalid_End_Date_Should_Not_Return_Template() |
|
|
|
public void LimitToDateRange_After_Invalid_End_Date_Should_Not_Return_Template() |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -210,6 +402,30 @@ public static class AlternateScheduleSelectorTests |
|
|
|
result.IsNone.ShouldBeTrue(); |
|
|
|
result.IsNone.ShouldBeTrue(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
|
|
|
public void LimitToDateRange_After_Invalid_End_Date_With_Year_Should_Not_Return_Template() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var template = new PlayoutTemplate |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DaysOfWeek = AlternateScheduleSelector.AllDaysOfWeek(), |
|
|
|
|
|
|
|
DaysOfMonth = AlternateScheduleSelector.AllDaysOfMonth(), |
|
|
|
|
|
|
|
MonthsOfYear = AlternateScheduleSelector.AllMonthsOfYear(), |
|
|
|
|
|
|
|
LimitToDateRange = true, |
|
|
|
|
|
|
|
StartMonth = 1, |
|
|
|
|
|
|
|
StartDay = 1, |
|
|
|
|
|
|
|
StartYear = 2023, |
|
|
|
|
|
|
|
EndMonth = 2, |
|
|
|
|
|
|
|
EndDay = 29, |
|
|
|
|
|
|
|
EndYear = 2023 |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Option<PlayoutTemplate> result = AlternateScheduleSelector.GetScheduleForDate( |
|
|
|
|
|
|
|
new List<PlayoutTemplate> { template }, |
|
|
|
|
|
|
|
new DateTimeOffset(2023, 3, 1, 0, 0, 0, Offset)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.IsNone.ShouldBeTrue(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
[Test] |
|
|
|
public void LimitToDateRange_Wrap_Around_Before_Start_Should_Not_Return_Template() |
|
|
|
public void LimitToDateRange_Wrap_Around_Before_Start_Should_Not_Return_Template() |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -232,6 +448,30 @@ public static class AlternateScheduleSelectorTests |
|
|
|
result.IsNone.ShouldBeTrue(); |
|
|
|
result.IsNone.ShouldBeTrue(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
|
|
|
public void LimitToDateRange_Wrap_Around_Before_Start_With_Year_Should_Not_Return_Template() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var template = new PlayoutTemplate |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DaysOfWeek = AlternateScheduleSelector.AllDaysOfWeek(), |
|
|
|
|
|
|
|
DaysOfMonth = AlternateScheduleSelector.AllDaysOfMonth(), |
|
|
|
|
|
|
|
MonthsOfYear = AlternateScheduleSelector.AllMonthsOfYear(), |
|
|
|
|
|
|
|
LimitToDateRange = true, |
|
|
|
|
|
|
|
StartMonth = 6, |
|
|
|
|
|
|
|
StartDay = 15, |
|
|
|
|
|
|
|
StartYear = 2023, |
|
|
|
|
|
|
|
EndMonth = 4, |
|
|
|
|
|
|
|
EndDay = 1, |
|
|
|
|
|
|
|
EndYear = 2024 |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Option<PlayoutTemplate> result = AlternateScheduleSelector.GetScheduleForDate( |
|
|
|
|
|
|
|
new List<PlayoutTemplate> { template }, |
|
|
|
|
|
|
|
new DateTimeOffset(2024, 6, 14, 0, 0, 0, Offset)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.IsNone.ShouldBeTrue(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
[Test] |
|
|
|
public void LimitToDateRange_Wrap_Around_On_Start_Should_Return_Template() |
|
|
|
public void LimitToDateRange_Wrap_Around_On_Start_Should_Return_Template() |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -254,6 +494,30 @@ public static class AlternateScheduleSelectorTests |
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
|
|
|
public void LimitToDateRange_Wrap_Around_On_Start_With_Year_Should_Return_Template() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var template = new PlayoutTemplate |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DaysOfWeek = AlternateScheduleSelector.AllDaysOfWeek(), |
|
|
|
|
|
|
|
DaysOfMonth = AlternateScheduleSelector.AllDaysOfMonth(), |
|
|
|
|
|
|
|
MonthsOfYear = AlternateScheduleSelector.AllMonthsOfYear(), |
|
|
|
|
|
|
|
LimitToDateRange = true, |
|
|
|
|
|
|
|
StartMonth = 6, |
|
|
|
|
|
|
|
StartDay = 15, |
|
|
|
|
|
|
|
StartYear = 2024, |
|
|
|
|
|
|
|
EndMonth = 4, |
|
|
|
|
|
|
|
EndDay = 1, |
|
|
|
|
|
|
|
EndYear = 2025 |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Option<PlayoutTemplate> result = AlternateScheduleSelector.GetScheduleForDate( |
|
|
|
|
|
|
|
new List<PlayoutTemplate> { template }, |
|
|
|
|
|
|
|
new DateTimeOffset(2024, 6, 15, 0, 0, 0, Offset)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
[Test] |
|
|
|
public void LimitToDateRange_Wrap_Around_In_Range_Should_Return_Template() |
|
|
|
public void LimitToDateRange_Wrap_Around_In_Range_Should_Return_Template() |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -276,6 +540,30 @@ public static class AlternateScheduleSelectorTests |
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
|
|
|
public void LimitToDateRange_Wrap_Around_In_Range_With_Year_Should_Return_Template() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var template = new PlayoutTemplate |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DaysOfWeek = AlternateScheduleSelector.AllDaysOfWeek(), |
|
|
|
|
|
|
|
DaysOfMonth = AlternateScheduleSelector.AllDaysOfMonth(), |
|
|
|
|
|
|
|
MonthsOfYear = AlternateScheduleSelector.AllMonthsOfYear(), |
|
|
|
|
|
|
|
LimitToDateRange = true, |
|
|
|
|
|
|
|
StartMonth = 6, |
|
|
|
|
|
|
|
StartDay = 15, |
|
|
|
|
|
|
|
StartYear = 2024, |
|
|
|
|
|
|
|
EndMonth = 4, |
|
|
|
|
|
|
|
EndDay = 1, |
|
|
|
|
|
|
|
EndYear = 2025 |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Option<PlayoutTemplate> result = AlternateScheduleSelector.GetScheduleForDate( |
|
|
|
|
|
|
|
new List<PlayoutTemplate> { template }, |
|
|
|
|
|
|
|
new DateTimeOffset(2024, 7, 20, 0, 0, 0, Offset)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
[Test] |
|
|
|
public void LimitToDateRange_Wrap_Around_On_End_Should_Return_Template() |
|
|
|
public void LimitToDateRange_Wrap_Around_On_End_Should_Return_Template() |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -298,6 +586,30 @@ public static class AlternateScheduleSelectorTests |
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
|
|
|
public void LimitToDateRange_Wrap_Around_On_End_With_Year_Should_Return_Template() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var template = new PlayoutTemplate |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DaysOfWeek = AlternateScheduleSelector.AllDaysOfWeek(), |
|
|
|
|
|
|
|
DaysOfMonth = AlternateScheduleSelector.AllDaysOfMonth(), |
|
|
|
|
|
|
|
MonthsOfYear = AlternateScheduleSelector.AllMonthsOfYear(), |
|
|
|
|
|
|
|
LimitToDateRange = true, |
|
|
|
|
|
|
|
StartMonth = 6, |
|
|
|
|
|
|
|
StartDay = 15, |
|
|
|
|
|
|
|
StartYear = 2023, |
|
|
|
|
|
|
|
EndMonth = 4, |
|
|
|
|
|
|
|
EndDay = 1, |
|
|
|
|
|
|
|
EndYear = 2024 |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Option<PlayoutTemplate> result = AlternateScheduleSelector.GetScheduleForDate( |
|
|
|
|
|
|
|
new List<PlayoutTemplate> { template }, |
|
|
|
|
|
|
|
new DateTimeOffset(2024, 4, 1, 0, 0, 0, Offset)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
[Test] |
|
|
|
public void LimitToDateRange_Wrap_Around_After_End_Should_Not_Return_Template() |
|
|
|
public void LimitToDateRange_Wrap_Around_After_End_Should_Not_Return_Template() |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -320,6 +632,30 @@ public static class AlternateScheduleSelectorTests |
|
|
|
result.IsNone.ShouldBeTrue(); |
|
|
|
result.IsNone.ShouldBeTrue(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
|
|
|
public void LimitToDateRange_Wrap_Around_After_End_With_Year_Should_Not_Return_Template() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var template = new PlayoutTemplate |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DaysOfWeek = AlternateScheduleSelector.AllDaysOfWeek(), |
|
|
|
|
|
|
|
DaysOfMonth = AlternateScheduleSelector.AllDaysOfMonth(), |
|
|
|
|
|
|
|
MonthsOfYear = AlternateScheduleSelector.AllMonthsOfYear(), |
|
|
|
|
|
|
|
LimitToDateRange = true, |
|
|
|
|
|
|
|
StartMonth = 6, |
|
|
|
|
|
|
|
StartDay = 15, |
|
|
|
|
|
|
|
StartYear = 2023, |
|
|
|
|
|
|
|
EndMonth = 4, |
|
|
|
|
|
|
|
EndDay = 1, |
|
|
|
|
|
|
|
EndYear = 2024 |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Option<PlayoutTemplate> result = AlternateScheduleSelector.GetScheduleForDate( |
|
|
|
|
|
|
|
new List<PlayoutTemplate> { template }, |
|
|
|
|
|
|
|
new DateTimeOffset(2024, 4, 2, 0, 0, 0, Offset)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.IsNone.ShouldBeTrue(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
[Test] |
|
|
|
public void LimitToDateRange_Wrap_Around_Before_Invalid_Start_Date_Should_Not_Return_Template() |
|
|
|
public void LimitToDateRange_Wrap_Around_Before_Invalid_Start_Date_Should_Not_Return_Template() |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -342,6 +678,30 @@ public static class AlternateScheduleSelectorTests |
|
|
|
result.IsNone.ShouldBeTrue(); |
|
|
|
result.IsNone.ShouldBeTrue(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
|
|
|
public void LimitToDateRange_Wrap_Around_Before_Invalid_Start_Date_With_Year_Should_Not_Return_Template() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var template = new PlayoutTemplate |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DaysOfWeek = AlternateScheduleSelector.AllDaysOfWeek(), |
|
|
|
|
|
|
|
DaysOfMonth = AlternateScheduleSelector.AllDaysOfMonth(), |
|
|
|
|
|
|
|
MonthsOfYear = AlternateScheduleSelector.AllMonthsOfYear(), |
|
|
|
|
|
|
|
LimitToDateRange = true, |
|
|
|
|
|
|
|
StartMonth = 2, |
|
|
|
|
|
|
|
StartDay = 29, |
|
|
|
|
|
|
|
StartYear = 2023, |
|
|
|
|
|
|
|
EndMonth = 1, |
|
|
|
|
|
|
|
EndDay = 1, |
|
|
|
|
|
|
|
EndYear = 2024 |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Option<PlayoutTemplate> result = AlternateScheduleSelector.GetScheduleForDate( |
|
|
|
|
|
|
|
new List<PlayoutTemplate> { template }, |
|
|
|
|
|
|
|
new DateTimeOffset(2023, 2, 28, 0, 0, 0, Offset)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.IsNone.ShouldBeTrue(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
[Test] |
|
|
|
public void LimitToDateRange_Wrap_Around_After_Invalid_Start_Date_Should_Return_Template() |
|
|
|
public void LimitToDateRange_Wrap_Around_After_Invalid_Start_Date_Should_Return_Template() |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -364,6 +724,30 @@ public static class AlternateScheduleSelectorTests |
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
|
|
|
public void LimitToDateRange_Wrap_Around_After_Invalid_Start_Date_With_Year_Should_Return_Template() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var template = new PlayoutTemplate |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DaysOfWeek = AlternateScheduleSelector.AllDaysOfWeek(), |
|
|
|
|
|
|
|
DaysOfMonth = AlternateScheduleSelector.AllDaysOfMonth(), |
|
|
|
|
|
|
|
MonthsOfYear = AlternateScheduleSelector.AllMonthsOfYear(), |
|
|
|
|
|
|
|
LimitToDateRange = true, |
|
|
|
|
|
|
|
StartMonth = 2, |
|
|
|
|
|
|
|
StartDay = 29, |
|
|
|
|
|
|
|
StartYear = 2023, |
|
|
|
|
|
|
|
EndMonth = 1, |
|
|
|
|
|
|
|
EndDay = 1, |
|
|
|
|
|
|
|
EndYear = 2024 |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Option<PlayoutTemplate> result = AlternateScheduleSelector.GetScheduleForDate( |
|
|
|
|
|
|
|
new List<PlayoutTemplate> { template }, |
|
|
|
|
|
|
|
new DateTimeOffset(2023, 3, 1, 0, 0, 0, Offset)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
[Test] |
|
|
|
public void LimitToDateRange_Wrap_Around_Before_Invalid_End_Date_Should_Return_Template() |
|
|
|
public void LimitToDateRange_Wrap_Around_Before_Invalid_End_Date_Should_Return_Template() |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -386,6 +770,30 @@ public static class AlternateScheduleSelectorTests |
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
|
|
|
public void LimitToDateRange_Wrap_Around_Before_Invalid_End_Date_With_Year_Should_Return_Template() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var template = new PlayoutTemplate |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DaysOfWeek = AlternateScheduleSelector.AllDaysOfWeek(), |
|
|
|
|
|
|
|
DaysOfMonth = AlternateScheduleSelector.AllDaysOfMonth(), |
|
|
|
|
|
|
|
MonthsOfYear = AlternateScheduleSelector.AllMonthsOfYear(), |
|
|
|
|
|
|
|
LimitToDateRange = true, |
|
|
|
|
|
|
|
StartMonth = 5, |
|
|
|
|
|
|
|
StartDay = 1, |
|
|
|
|
|
|
|
StartYear = 2022, |
|
|
|
|
|
|
|
EndMonth = 2, |
|
|
|
|
|
|
|
EndDay = 29, |
|
|
|
|
|
|
|
EndYear = 2023 |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Option<PlayoutTemplate> result = AlternateScheduleSelector.GetScheduleForDate( |
|
|
|
|
|
|
|
new List<PlayoutTemplate> { template }, |
|
|
|
|
|
|
|
new DateTimeOffset(2023, 2, 28, 0, 0, 0, Offset)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.IsSome.ShouldBeTrue(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
[Test] |
|
|
|
public void LimitToDateRange_Wrap_Around_After_Invalid_End_Date_Should_Not_Return_Template() |
|
|
|
public void LimitToDateRange_Wrap_Around_After_Invalid_End_Date_Should_Not_Return_Template() |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -407,5 +815,29 @@ public static class AlternateScheduleSelectorTests |
|
|
|
|
|
|
|
|
|
|
|
result.IsNone.ShouldBeTrue(); |
|
|
|
result.IsNone.ShouldBeTrue(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
|
|
|
public void LimitToDateRange_Wrap_Around_After_Invalid_End_Date_With_Year_Should_Not_Return_Template() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var template = new PlayoutTemplate |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DaysOfWeek = AlternateScheduleSelector.AllDaysOfWeek(), |
|
|
|
|
|
|
|
DaysOfMonth = AlternateScheduleSelector.AllDaysOfMonth(), |
|
|
|
|
|
|
|
MonthsOfYear = AlternateScheduleSelector.AllMonthsOfYear(), |
|
|
|
|
|
|
|
LimitToDateRange = true, |
|
|
|
|
|
|
|
StartMonth = 5, |
|
|
|
|
|
|
|
StartDay = 1, |
|
|
|
|
|
|
|
StartYear = 2022, |
|
|
|
|
|
|
|
EndMonth = 2, |
|
|
|
|
|
|
|
EndDay = 29, |
|
|
|
|
|
|
|
EndYear = 2023 |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Option<PlayoutTemplate> result = AlternateScheduleSelector.GetScheduleForDate( |
|
|
|
|
|
|
|
new List<PlayoutTemplate> { template }, |
|
|
|
|
|
|
|
new DateTimeOffset(2023, 3, 1, 0, 0, 0, Offset)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.IsNone.ShouldBeTrue(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|