< Summary

Information
Class: Elsa.Scheduling.Schedules.SpecificInstantSchedule
Assembly: Elsa.Scheduling
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Scheduling/Schedules/SpecificInstantSchedule.cs
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 32
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%
Schedule(...)100%11100%

File(s)

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

#LineLine coverage
 1using Elsa.Scheduling.ScheduledTasks;
 2using JetBrains.Annotations;
 3using Microsoft.Extensions.DependencyInjection;
 4
 5namespace Elsa.Scheduling.Schedules;
 6
 7/// <summary>
 8/// A schedule that can be used to schedule a task at a specific instant.
 9/// </summary>
 10[PublicAPI]
 11public class SpecificInstantSchedule : ISchedule
 12{
 13    /// <summary>
 14    /// Initializes a new instance of the <see cref="SpecificInstantSchedule"/> class.
 15    /// </summary>
 16    /// <param name="startAt">The date and time to schedule the task for.</param>
 1717    public SpecificInstantSchedule(DateTimeOffset startAt)
 18    {
 1719        StartAt = startAt;
 1720    }
 21
 22    /// <summary>
 23    /// The date and time to schedule the task for.
 24    /// </summary>
 3425    public DateTimeOffset StartAt { get; init; }
 26
 27    /// <inheritdoc />
 28    public IScheduledTask Schedule(ScheduleContext context)
 29    {
 1730        return ActivatorUtilities.CreateInstance<ScheduledSpecificInstantTask>(context.ServiceProvider, context.Task, St
 31    }
 32}