< Summary

Information
Class: Elsa.Workflows.Management.Models.WorkflowDefinitionSummary
Assembly: Elsa.Workflows.Management
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Management/Models/WorkflowDefinitionSummary.cs
Line coverage
64%
Covered lines: 27
Uncovered lines: 15
Coverable lines: 42
Total lines: 110
Line coverage: 64.2%
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
FromDefinition(...)100%210%
FromDefinitionExpression()100%11100%
get_Id()100%11100%
get_DefinitionId()100%11100%
get_Name()100%11100%
get_Description()100%11100%
get_Version()100%11100%
get_ToolVersion()100%11100%
get_IsLatest()100%11100%
get_IsPublished()100%11100%
get_ProviderName()100%11100%
get_MaterializerName()100%11100%
get_CreatedAt()100%11100%
get_IsReadonly()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Management/Models/WorkflowDefinitionSummary.cs

#LineLine coverage
 1using System.Linq.Expressions;
 2using Elsa.Workflows.Management.Entities;
 3using JetBrains.Annotations;
 4
 5namespace Elsa.Workflows.Management.Models;
 6
 7/// <summary>
 8/// A summary of a workflow definition.
 9/// </summary>
 10[PublicAPI]
 11public class WorkflowDefinitionSummary
 12{
 13    /// <summary>
 14    /// Creates a new instance of the <see cref="WorkflowDefinitionSummary"/> class from the specified <see cref="Workfl
 15    /// </summary>
 016    public static WorkflowDefinitionSummary FromDefinition(WorkflowDefinition workflowDefinition) => new()
 017    {
 018        Id = workflowDefinition.Id,
 019        DefinitionId = workflowDefinition.DefinitionId,
 020        Name = workflowDefinition.Name,
 021        Description = workflowDefinition.Description,
 022        Version = workflowDefinition.Version,
 023        ToolVersion = workflowDefinition.ToolVersion,
 024        IsLatest = workflowDefinition.IsLatest,
 025        IsPublished = workflowDefinition.IsPublished,
 026        ProviderName = workflowDefinition.ProviderName,
 027        MaterializerName = workflowDefinition.MaterializerName,
 028        CreatedAt = workflowDefinition.CreatedAt,
 029        IsReadonly = workflowDefinition.IsReadonly
 030    };
 31
 32    /// <summary>
 33    /// Creates a new instance of the <see cref="WorkflowDefinitionSummary"/> class from the specified <see cref="Workfl
 34    /// </summary>
 235    public static Expression<Func<WorkflowDefinition, WorkflowDefinitionSummary>> FromDefinitionExpression() => workflow
 236    {
 237        Id = workflowDefinition.Id,
 238        DefinitionId = workflowDefinition.DefinitionId,
 239        Name = workflowDefinition.Name,
 240        Description = workflowDefinition.Description,
 241        Version = workflowDefinition.Version,
 242        ToolVersion = workflowDefinition.ToolVersion,
 243        IsLatest = workflowDefinition.IsLatest,
 244        IsPublished = workflowDefinition.IsPublished,
 245        ProviderName = workflowDefinition.ProviderName,
 246        MaterializerName = workflowDefinition.MaterializerName,
 247        CreatedAt = workflowDefinition.CreatedAt,
 248        IsReadonly = workflowDefinition.IsReadonly
 249    };
 50
 51    /// <summary>
 52    /// The version ID of the workflow definition.
 53    /// </summary>
 36854    public string Id { get; set; } = null!;
 55
 56    /// <summary>
 57    /// The ID of the workflow definition.
 58    /// </summary>
 36959    public string DefinitionId { get; set; } = null!;
 60
 61    /// <summary>
 62    /// The name of the workflow definition.
 63    /// </summary>
 14864    public string? Name { get; set; }
 65
 66    /// <summary>
 67    /// The description of the workflow definition.
 68    /// </summary>
 14869    public string? Description { get; set; }
 70
 71    /// <summary>
 72    /// The version of the workflow definition.
 73    /// </summary>
 36974    public int? Version { get; set; }
 75
 76    /// <summary>
 77    /// The version of the tool that created the workflow definition.
 78    /// </summary>
 14879    public Version? ToolVersion { get; set; }
 80
 81    /// <summary>
 82    /// Whether this is the latest version of the workflow definition.
 83    /// </summary>
 14884    public bool IsLatest { get; set; }
 85
 86    /// <summary>
 87    /// Whether this workflow definition is published.
 88    /// </summary>
 14889    public bool IsPublished { get; set; }
 90
 91    /// <summary>
 92    /// The provider name of the workflow definition.
 93    /// </summary>
 14894    public string? ProviderName { get; set; }
 95
 96    /// <summary>
 97    /// The materializer name of the workflow definition.
 98    /// </summary>
 14899    public string MaterializerName { get; set; } = null!;
 100
 101    /// <summary>
 102    /// The timestamp when the workflow definition was created.
 103    /// </summary>
 148104    public DateTimeOffset CreatedAt { get; set; }
 105
 106    /// <summary>
 107    /// Makes workflow
 108    /// </summary>
 148109    public bool IsReadonly { get; set; }
 110}