< Summary

Information
Class: Elsa.Expressions.Python.Models.OutcomeProxy
Assembly: Elsa.Expressions.Python
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Expressions.Python/Models/OutcomeProxy.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 7
Coverable lines: 7
Total lines: 34
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
.cctor()100%210%
.ctor(...)100%210%
get_ExpressionExecutionContext()100%210%
Set(...)100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Expressions.Python/Models/OutcomeProxy.cs

#LineLine coverage
 1using Elsa.Expressions.Models;
 2// ReSharper disable InconsistentNaming
 3
 4namespace Elsa.Expressions.Python.Models;
 5
 6/// <summary>
 7/// Provides access to activity outcomes.
 8/// </summary>
 9public class OutcomeProxy
 10{
 11    /// <summary>
 12    /// Gets the key of the outcomes property.
 13    /// </summary>
 014    public static readonly object OutcomePropertiesKey = new();
 15
 16    /// <summary>
 17    /// Initializes a new instance of the <see cref="OutcomeProxy"/> class.
 18    /// </summary>
 019    public OutcomeProxy(ExpressionExecutionContext expressionExecutionContext)
 20    {
 021        ExpressionExecutionContext = expressionExecutionContext;
 022    }
 23
 024    private ExpressionExecutionContext ExpressionExecutionContext { get; }
 25
 26    /// <summary>
 27    /// Sets the outcome of the current activity.
 28    /// </summary>
 29    /// <param name="outcomeNames">The names of the outcomes.</param>
 30    public void Set(params string[] outcomeNames)
 31    {
 032        ExpressionExecutionContext.TransientProperties[OutcomePropertiesKey] = outcomeNames;
 033    }
 34}