< Summary

Information
Class: Elsa.Common.RecurringTasks.IntervalExpression
Assembly: Elsa.Common
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Common/RecurringTasks/IntervalExpression.cs
Line coverage
58%
Covered lines: 7
Uncovered lines: 5
Coverable lines: 12
Total lines: 25
Line coverage: 58.3%
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
FromInterval(...)100%11100%
FromCron(...)100%210%
get_Type()100%11100%
get_Expression()100%11100%

File(s)

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

#LineLine coverage
 1namespace Elsa.Common.RecurringTasks;
 2
 3public class IntervalExpression
 4{
 5    public static IntervalExpression FromInterval(TimeSpan interval)
 6    {
 77        return new IntervalExpression
 78        {
 79            Type = IntervalExpressionType.Interval,
 710            Expression = interval.ToString()
 711        };
 12    }
 13
 14    public static IntervalExpression FromCron(string cronExpression)
 15    {
 016        return new IntervalExpression
 017        {
 018            Type = IntervalExpressionType.Cron,
 019            Expression = cronExpression
 020        };
 21    }
 22
 1023    public IntervalExpressionType Type { get; set; }
 1024    public string Expression { get; set; } = default!;
 25}