< Summary

Information
Class: Elsa.Workflows.Models.ActivityHandle
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Models/ActivityHandle.cs
Line coverage
23%
Covered lines: 5
Uncovered lines: 16
Coverable lines: 21
Total lines: 37
Line coverage: 23.8%
Branch coverage
0%
Covered branches: 0
Total branches: 8
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
FromActivityId(...)100%210%
FromActivityNodeId(...)100%210%
FromActivityInstanceId(...)100%11100%
FromActivityHash(...)100%210%
get_ActivityId()100%210%
get_ActivityNodeId()100%210%
get_ActivityInstanceId()100%11100%
get_ActivityHash()100%210%
ToString()0%7280%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Models/ActivityHandle.cs

#LineLine coverage
 1namespace Elsa.Workflows.Models;
 2
 3/// <summary>
 4/// Represents a handle to an activity.
 5/// </summary>
 6public class ActivityHandle
 7{
 08    public static ActivityHandle FromActivityId(string activityId) => new()
 09    {
 010        ActivityId = activityId
 011    };
 12
 013    public static ActivityHandle FromActivityNodeId(string activityNodeId) => new()
 014    {
 015        ActivityNodeId = activityNodeId
 016    };
 17
 218    public static ActivityHandle FromActivityInstanceId(string activityInstanceId) => new()
 219    {
 220        ActivityInstanceId = activityInstanceId
 221    };
 22
 023    public static ActivityHandle FromActivityHash(string activityHash) => new()
 024    {
 025        ActivityHash = activityHash
 026    };
 27
 028    public string? ActivityId { get; init; }
 029    public string? ActivityNodeId { get; init; }
 230    public string? ActivityInstanceId { get; init; }
 031    public string? ActivityHash { get; init; }
 32
 33    public override string ToString()
 34    {
 035        return ActivityId ?? (ActivityNodeId ?? (ActivityInstanceId ?? (ActivityHash ?? "")));
 36    }
 37}