< Summary

Information
Class: Elsa.Testing.Shared.Handlers.WorkflowEventHandlers
Assembly: Elsa.Testing.Shared.Component
File(s): /home/runner/work/elsa-core/elsa-core/src/common/Elsa.Testing.Shared.Component/Handlers/WorkflowEventHandlers.cs
Line coverage
100%
Covered lines: 11
Uncovered lines: 0
Coverable lines: 11
Total lines: 47
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%
HandleAsync(...)100%11100%
HandleAsync(...)100%11100%
HandleAsync(...)100%11100%
HandleAsync(...)100%11100%
HandleAsync(...)100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/common/Elsa.Testing.Shared.Component/Handlers/WorkflowEventHandlers.cs

#LineLine coverage
 1using Elsa.Mediator.Contracts;
 2using Elsa.Testing.Shared.Services;
 3using Elsa.Workflows.Management.Notifications;
 4using Elsa.Workflows.Notifications;
 5using Elsa.Workflows.Runtime.Notifications;
 6using JetBrains.Annotations;
 7
 8namespace Elsa.Testing.Shared.Handlers;
 9
 10[UsedImplicitly]
 31911public class WorkflowEventHandlers(WorkflowEvents workflowEvents) :
 12    INotificationHandler<WorkflowFinished>,
 13    INotificationHandler<WorkflowInstanceSaved>,
 14    INotificationHandler<WorkflowStateCommitted>,
 15    INotificationHandler<ActivityExecuted>,
 16    INotificationHandler<ActivityExecutionLogUpdated>
 17{
 18    public Task HandleAsync(WorkflowFinished notification, CancellationToken cancellationToken)
 19    {
 27920        workflowEvents.OnWorkflowFinished(new(notification.Workflow, notification.WorkflowState));
 27921        return Task.CompletedTask;
 22    }
 23
 24    public Task HandleAsync(WorkflowInstanceSaved notification, CancellationToken cancellationToken)
 25    {
 34926        workflowEvents.OnWorkflowInstanceSaved(new(notification.WorkflowInstance));
 34927        return Task.CompletedTask;
 28    }
 29
 30    public Task HandleAsync(WorkflowStateCommitted notification, CancellationToken cancellationToken)
 31    {
 32332        workflowEvents.OnWorkflowStateCommitted(new(notification.WorkflowExecutionContext, notification.WorkflowState, n
 32333        return Task.CompletedTask;
 34    }
 35
 36    public Task HandleAsync(ActivityExecuted notification, CancellationToken cancellationToken)
 37    {
 239238        workflowEvents.OnActivityExecuted(new(notification.ActivityExecutionContext));
 239239        return Task.CompletedTask;
 40    }
 41
 42    public Task HandleAsync(ActivityExecutionLogUpdated notification, CancellationToken cancellationToken)
 43    {
 32344        workflowEvents.OnActivityExecutedLogUpdated(new(notification.WorkflowExecutionContext, notification.Records));
 32345        return Task.CompletedTask;
 46    }
 47}