< Summary

Information
Class: Elsa.Common.RecurringTasks.RecurringTaskSchedule
Assembly: Elsa.Common
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Common/RecurringTasks/RecurringTaskSchedule.cs
Line coverage
77%
Covered lines: 7
Uncovered lines: 2
Coverable lines: 9
Total lines: 26
Line coverage: 77.7%
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
get_ScheduledTasks()100%11100%
ConfigureTask(...)100%11100%
ConfigureTask(...)100%210%
ConfigureTask(...)100%11100%
ConfigureTask(...)100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Common/RecurringTasks/RecurringTaskSchedule.cs

#LineLine coverage
 1namespace Elsa.Common.RecurringTasks;
 2
 3public class RecurringTaskSchedule
 4{
 115    public IDictionary<Type, IntervalExpression> ScheduledTasks { get; } = new Dictionary<Type, IntervalExpression>();
 6
 7    public void ConfigureTask<T>(TimeSpan interval) where T : IRecurringTask
 8    {
 79        ConfigureTask<T>(IntervalExpression.FromInterval(interval));
 710    }
 11
 12    public void ConfigureTask<T>(string cronExpression) where T : IRecurringTask
 13    {
 014        ConfigureTask<T>(IntervalExpression.FromCron(cronExpression));
 015    }
 16
 17    public void ConfigureTask<T>(IntervalExpression intervalExpression) where T : IRecurringTask
 18    {
 719        ConfigureTask(typeof(T), intervalExpression);
 720    }
 21
 22    public void ConfigureTask(Type recurringTaskType, IntervalExpression intervalExpression)
 23    {
 724        ScheduledTasks[recurringTaskType] = intervalExpression;
 725    }
 26}