< Summary

Information
Class: Elsa.Extensions.WorkflowTriggerExtensions
Assembly: Elsa.Workflows.Runtime
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Extensions/WorkflowTriggerExtensions.cs
Line coverage
100%
Covered lines: 2
Uncovered lines: 0
Coverable lines: 2
Total lines: 23
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
Filter(...)100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Extensions/WorkflowTriggerExtensions.cs

#LineLine coverage
 1using Elsa.Workflows;
 2using Elsa.Workflows.Helpers;
 3using Elsa.Workflows.Runtime.Entities;
 4
 5// ReSharper disable once CheckNamespace
 6namespace Elsa.Extensions;
 7
 8/// <summary>
 9/// Extension methods for <see cref="StoredTrigger"/>.
 10/// </summary>
 11public static class WorkflowTriggerExtensions
 12{
 13    /// <summary>
 14    /// Filters a collection of <see cref="StoredTrigger"/> by trigger type.
 15    /// </summary>
 16    /// <param name="triggers">The collection of triggers to filter.</param>
 17    /// <typeparam name="T">The trigger type.</typeparam>
 18    public static IEnumerable<StoredTrigger> Filter<T>(this IEnumerable<StoredTrigger> triggers) where T : ITrigger
 19    {
 383420        var triggerName = ActivityTypeNameHelper.GenerateTypeName<T>();
 391221        return triggers.Where(x => x.Name == triggerName);
 22    }
 23}