< Summary

Information
Class: Elsa.Workflows.Runtime.WorkflowInstanceStoreExtensions
Assembly: Elsa.Workflows.Runtime
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Extensions/WorkflowInstanceStoreExtensions.cs
Line coverage
70%
Covered lines: 7
Uncovered lines: 3
Coverable lines: 10
Total lines: 33
Line coverage: 70%
Branch coverage
25%
Covered branches: 2
Total branches: 8
Branch coverage: 25%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
EnumerateSummariesAsync()25%10870%

File(s)

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

#LineLine coverage
 1using System.Runtime.CompilerServices;
 2using Elsa.Common.Models;
 3using Elsa.Workflows.Management;
 4using Elsa.Workflows.Management.Filters;
 5using Elsa.Workflows.Management.Models;
 6
 7namespace Elsa.Workflows.Runtime;
 8
 9public static class WorkflowInstanceStoreExtensions
 10{
 11    public static async IAsyncEnumerable<WorkflowInstanceSummary> EnumerateSummariesAsync(
 12        this IWorkflowInstanceStore store,
 13        WorkflowInstanceFilter filter,
 14        int batchSize = 100,
 15        [EnumeratorCancellation] CancellationToken cancellationToken = default)
 16    {
 217        var pageArgs = PageArgs.FromPage(0, batchSize);
 18
 219        while (!cancellationToken.IsCancellationRequested)
 20        {
 221            var page = await store.SummarizeManyAsync(filter, pageArgs, cancellationToken);
 222            var workflowInstances = page.Items;
 23
 224            if (workflowInstances.Count == 0)
 225                yield break;
 26
 027            foreach (var workflowInstance in workflowInstances)
 028                yield return workflowInstance;
 29
 030            pageArgs = pageArgs.Next();
 31        }
 232    }
 33}

Methods/Properties

EnumerateSummariesAsync()