< Summary

Information
Class: Elsa.Workflows.Management.ActivityDescriberExtensions
Assembly: Elsa.Workflows.Management
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Management/Extensions/ActivityDescriberExtensions.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 6
Coverable lines: 6
Total lines: 45
Line coverage: 0%
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
DescribeOutputProperty()100%210%
DescribeInputPropertyAsync()100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Management/Extensions/ActivityDescriberExtensions.cs

#LineLine coverage
 1using System.Linq.Expressions;
 2using Elsa.Extensions;
 3using Elsa.Workflows.Models;
 4using JetBrains.Annotations;
 5
 6namespace Elsa.Workflows.Management;
 7
 8/// <summary>
 9/// Provides extension methods for <see cref="IActivityDescriber"/>.
 10/// </summary>
 11[PublicAPI]
 12public static class ActivityDescriberExtensions
 13{
 14    /// <param name="activityDescriber">The activity describer.</param>
 15    extension(IActivityDescriber activityDescriber)
 16    {
 17        /// <summary>
 18        /// Describes an output property.
 19        /// </summary>
 20        /// <param name="expression">The property expression.</param>
 21        /// <param name="cancellationToken">The cancellation token.</param>
 22        /// <typeparam name="TActivity">The type of the activity.</typeparam>
 23        /// <typeparam name="TProperty">The type of the property.</typeparam>
 24        /// <returns>The output descriptor.</returns>
 25        public async Task<OutputDescriptor> DescribeOutputProperty<TActivity, TProperty>(Expression<Func<TActivity, TPro
 26        {
 027            var propertyInfo = expression.GetProperty()!;
 028            return await activityDescriber.DescribeOutputPropertyAsync(propertyInfo, cancellationToken);
 029        }
 30
 31        /// <summary>
 32        /// Describes an input property.
 33        /// </summary>
 34        /// <param name="expression">The property expression.</param>
 35        /// <param name="cancellationToken">The cancellation token.</param>
 36        /// <typeparam name="TActivity">The type of the activity.</typeparam>
 37        /// <typeparam name="TProperty">The type of the property.</typeparam>
 38        /// <returns>The input descriptor.</returns>
 39        public async Task<InputDescriptor> DescribeInputPropertyAsync<TActivity, TProperty>(Expression<Func<TActivity, T
 40        {
 041            var propertyInfo = expression.GetProperty()!;
 042            return await activityDescriber.DescribeInputPropertyAsync(propertyInfo, cancellationToken);
 043        }
 44    }
 45}