feat: add campaign templates and recurring schedules
This commit is contained in:
@@ -37,6 +37,35 @@ public sealed class BatchSchedulePlannerTests
|
||||
Assert.Throws<ArgumentOutOfRangeException>(action);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BuildRecurringSchedule_CreatesFixedIntervalScheduleFromFirstDate()
|
||||
{
|
||||
var firstScheduledAt = new DateTime(2026, 5, 4, 16, 0, 0, DateTimeKind.Utc);
|
||||
|
||||
var result = BatchSchedulePlanner.BuildRecurringSchedule(firstScheduledAt, sessionCount: 3, intervalDays: 14);
|
||||
|
||||
Assert.Equal(
|
||||
[
|
||||
firstScheduledAt,
|
||||
firstScheduledAt.AddDays(14),
|
||||
firstScheduledAt.AddDays(28)
|
||||
],
|
||||
result);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0, 7)]
|
||||
[InlineData(53, 7)]
|
||||
[InlineData(3, 0)]
|
||||
public void BuildRecurringSchedule_RejectsInvalidTemplateShape(int sessionCount, int intervalDays)
|
||||
{
|
||||
var firstScheduledAt = new DateTime(2026, 5, 4, 16, 0, 0, DateTimeKind.Utc);
|
||||
|
||||
var action = () => BatchSchedulePlanner.BuildRecurringSchedule(firstScheduledAt, sessionCount, intervalDays);
|
||||
|
||||
Assert.Throws<ArgumentOutOfRangeException>(action);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(BatchCloneInterval.NextWeek, 2026, 5, 8)]
|
||||
[InlineData(BatchCloneInterval.NextMonth, 2026, 6, 1)]
|
||||
|
||||
Reference in New Issue
Block a user