< Summary

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

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Extensions/ExpressionEvaluatorExtensions.cs

#LineLine coverage
 1using Elsa.Expressions.Contracts;
 2using Elsa.Expressions.Models;
 3using Elsa.Workflows.Models;
 4
 5// ReSharper disable once CheckNamespace
 6namespace Elsa.Extensions;
 7
 8/// <summary>
 9/// Contains extension methods for <see cref="IExpressionEvaluator"/>.
 10/// </summary>
 11public static class ExpressionEvaluatorExtensions
 12{
 13    extension(IExpressionEvaluator evaluator)
 14    {
 15        /// <summary>
 16        /// Evaluates the specified expression and returns the result.
 17        /// </summary>
 18        public ValueTask<T?> EvaluateAsync<T>(Input<T> input, ExpressionExecutionContext context, ExpressionEvaluatorOpt
 19        {
 320            return evaluator.EvaluateAsync<T>(input.Expression!, context, options);
 21        }
 22
 23        /// <summary>
 24        /// Evaluates the specified expression and returns the result.
 25        /// </summary>
 26        public ValueTask<object?> EvaluateAsync(Input input, ExpressionExecutionContext context, ExpressionEvaluatorOpti
 27        {
 271028            return evaluator.EvaluateAsync(input.Expression!, input.Type, context, options);
 29        }
 30    }
 31}