< Summary

Information
Class: Elsa.Workflows.Models.WorkflowDefinitionHandle
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Models/WorkflowDefinitionHandle.cs
Line coverage
50%
Covered lines: 5
Uncovered lines: 5
Coverable lines: 10
Total lines: 48
Line coverage: 50%
Branch coverage
0%
Covered branches: 0
Total branches: 4
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_DefinitionId()100%11100%
get_VersionOptions()100%11100%
get_DefinitionVersionId()100%11100%
ByDefinitionId(...)100%11100%
ByDefinitionVersionId(...)100%11100%
ToString()0%2040%

File(s)

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

#LineLine coverage
 1using Elsa.Common.Models;
 2
 3namespace Elsa.Workflows.Models;
 4
 5/// <summary>
 6/// Represents a handle to a workflow definition.
 7/// </summary>
 8public class WorkflowDefinitionHandle
 9{
 10    /// <summary>
 11    /// Gets or sets the definition ID. When set, the <see cref="DefinitionVersionId"/> property is ignored.
 12    /// </summary>
 55213    public string? DefinitionId { get; set; }
 14
 15    /// <summary>
 16    /// Gets or sets the version options. When set, the <see cref="DefinitionVersionId"/> property is ignored.
 17    /// </summary>
 55218    public VersionOptions? VersionOptions { get; set; }
 19
 20    /// <summary>
 21    /// Gets or sets the definition version ID. When set, the <see cref="DefinitionId"/> and <see cref="VersionOptions"/
 22    /// </summary>
 72723    public string? DefinitionVersionId { get; set; }
 24
 25    /// <summary>
 26    /// Creates a new <see cref="WorkflowDefinitionHandle"/> instance with the specified definition ID and version optio
 27    /// </summary>
 7328    public static WorkflowDefinitionHandle ByDefinitionId(string definitionId, VersionOptions? versionOptions = null) =>
 29
 30    /// <summary>
 31    /// Creates a new <see cref="WorkflowDefinitionHandle"/> instance with the specified definition version ID.
 32    /// </summary>
 33    /// <param name="definitionVersionId"></param>
 34    /// <returns></returns>
 24835    public static WorkflowDefinitionHandle ByDefinitionVersionId(string definitionVersionId) => new() { DefinitionVersio
 36
 37    /// <inheritdoc />
 38    public override string ToString()
 39    {
 040        if (DefinitionId != null)
 041            return $"DefinitionId: {DefinitionId}, VersionOptions: {VersionOptions}";
 42
 043        if (DefinitionVersionId != null)
 044            return $"DefinitionVersionId: {DefinitionVersionId}";
 45
 046        return string.Empty;
 47    }
 48}