< Summary

Information
Class: Elsa.Workflows.CommitStates.ObjectMetadataDescriber
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/CommitStates/Helpers/ObjectMetadataDescriber.cs
Line coverage
100%
Covered lines: 10
Uncovered lines: 0
Coverable lines: 10
Total lines: 23
Line coverage: 100%
Branch coverage
60%
Covered branches: 6
Total branches: 10
Branch coverage: 60%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
Describe(...)60%1010100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/CommitStates/Helpers/ObjectMetadataDescriber.cs

#LineLine coverage
 1using System.ComponentModel;
 2using System.Reflection;
 3using Humanizer;
 4
 5namespace Elsa.Workflows.CommitStates;
 6
 7public static class ObjectMetadataDescriber
 8{
 9    public static CommitStrategyMetadata Describe(Type strategyType)
 10    {
 911        var suffix = strategyType.IsAssignableTo(typeof(IActivityCommitStrategy)) ? "ActivityStrategy" : "WorkflowStrate
 912        var name = strategyType.Name.Replace(suffix, "");
 913        var displayName = strategyType.GetCustomAttribute<DisplayNameAttribute>()?.DisplayName ?? strategyType.Name.Repl
 914        var description = strategyType.GetCustomAttribute<DescriptionAttribute>()?.Description ?? string.Empty;
 15
 916        return new()
 917        {
 918            Name = name,
 919            DisplayName = displayName,
 920            Description = description
 921        };
 22    }
 23}

Methods/Properties

Describe(System.Type)