< Summary

Information
Class: Elsa.Workflows.Expressions.OutputExpressionHandler
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Expressions/OutputExpressionHandler.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 2
Coverable lines: 2
Total lines: 19
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/OutputExpressionHandler.cs

#LineLine coverage
 1using Elsa.Expressions.Contracts;
 2using Elsa.Expressions.Models;
 3using Elsa.Extensions;
 4using Elsa.Workflows.Models;
 5
 6namespace Elsa.Workflows.Expressions;
 7
 8/// <summary>
 9/// Evaluates an <see cref="Output"/> expression.
 10/// </summary>
 11public class OutputExpressionHandler : IExpressionHandler
 12{
 13    /// <inheritdoc />
 14    public ValueTask<object?> EvaluateAsync(Expression expression, Type returnType, ExpressionExecutionContext context, 
 15    {
 016        var value = expression.Value is Output output ? context.Get(output) : default;
 017        return ValueTask.FromResult(value);
 18    }
 19}