< Summary

Information
Class: Elsa.Workflows.Expressions.InputExpressionHandler
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Expressions/InputExpressionHandler.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 5
Coverable lines: 5
Total lines: 28
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
EvaluateAsync(...)0%620%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Expressions/InputExpressionHandler.cs

#LineLine coverage
 1using System.Diagnostics;
 2using Elsa.Expressions.Contracts;
 3using Elsa.Expressions.Models;
 4using Elsa.Extensions;
 5using Elsa.Workflows.Memory;
 6using Elsa.Workflows.Models;
 7
 8namespace Elsa.Workflows.Expressions;
 9
 10/// <summary>
 11/// Handles Input expressions.
 12/// </summary>
 13public class InputExpressionHandler : IExpressionHandler
 14{
 15    /// <inheritdoc />
 16    public ValueTask<object?> EvaluateAsync(Expression expression, Type returnType, ExpressionExecutionContext context, 
 17    {
 018        object? result = null;
 019        var inputDefinition = expression.Value as InputDefinition;
 20
 021        if (inputDefinition != null)
 22        {
 023            result = context.GetInput(inputDefinition.Name);
 24        }
 25
 026        return ValueTask.FromResult(result);
 27    }
 28}