< Summary

Information
Class: Elsa.Scheduling.Schedules.RecurringSchedule
Assembly: Elsa.Scheduling
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Scheduling/Schedules/RecurringSchedule.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 37
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_StartAt()100%11100%
get_Interval()100%11100%
Schedule(...)100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Scheduling/Schedules/RecurringSchedule.cs

#LineLine coverage
 1using Elsa.Scheduling.ScheduledTasks;
 2using JetBrains.Annotations;
 3using Microsoft.Extensions.DependencyInjection;
 4
 5namespace Elsa.Scheduling.Schedules;
 6
 7/// <summary>
 8/// A recurring schedule.
 9/// </summary>
 10[PublicAPI]
 11public class RecurringSchedule : ISchedule
 12{
 13    /// <summary>
 14    /// Initializes a new instance of the <see cref="RecurringSchedule"/> class.
 15    /// </summary>
 16    /// <param name="startAt">The time at which the first occurrence should occur.</param>
 17    /// <param name="interval">The interval between occurrences.</param>
 218    public RecurringSchedule(DateTimeOffset startAt, TimeSpan interval)
 19    {
 220        StartAt = startAt;
 221        Interval = interval;
 222    }
 23
 24    /// <summary>
 25    /// The time at which the first occurrence should occur.
 26    /// </summary>
 427    public DateTimeOffset StartAt { get; init; }
 28
 29    /// <summary>
 30    /// The interval between occurrences.
 31    /// </summary>
 432    public TimeSpan Interval { get; init; }
 33
 34    /// <inheritdoc />
 35    public IScheduledTask Schedule(ScheduleContext context) =>
 236        ActivatorUtilities.CreateInstance<ScheduledRecurringTask>(context.ServiceProvider, context.Task, StartAt, Interv
 37}