< Summary

Information
Class: Elsa.Workflows.Management.Materializers.TypedWorkflowMaterializer
Assembly: Elsa.Workflows.Management
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Management/Materializers/TypedWorkflowMaterializer.cs
Line coverage
40%
Covered lines: 2
Uncovered lines: 3
Coverable lines: 5
Total lines: 28
Line coverage: 40%
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%
get_Name()100%11100%
MaterializeAsync(...)100%210%
ToWorkflow(...)100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Management/Materializers/TypedWorkflowMaterializer.cs

#LineLine coverage
 1using Elsa.Workflows.Activities;
 2using Elsa.Workflows.Management.Entities;
 3using Elsa.Workflows.Management.Mappers;
 4
 5namespace Elsa.Workflows.Management.Materializers;
 6
 7/// <summary>
 8/// A workflow materializer that deserializes workflows created in C# code.
 9/// </summary>
 26610public class TypedWorkflowMaterializer(WorkflowDefinitionMapper workflowDefinitionMapper) : IWorkflowMaterializer
 11{
 12    /// <summary>
 13    /// The name of the materializer.
 14    /// </summary>
 15    public const string MaterializerName = "Typed";
 16
 17    /// <inheritdoc />
 139118    public string Name => MaterializerName;
 19
 20    /// <inheritdoc />
 21    public ValueTask<Workflow> MaterializeAsync(WorkflowDefinition definition, CancellationToken cancellationToken)
 22    {
 023        var workflow = ToWorkflow(definition);
 024        return new ValueTask<Workflow>(workflow);
 25    }
 26
 027    private Workflow ToWorkflow(WorkflowDefinition definition) => workflowDefinitionMapper.Map(definition);
 28}