< Summary

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

#LineLine coverage
 1using Elsa.Expressions.Models;
 2
 3namespace Elsa.Expressions.CSharp.Models;
 4
 5/// <summary>
 6/// Provides access to activity outcomes.
 7/// </summary>
 8public class OutcomeProxy
 9{
 10    /// <summary>
 11    /// Gets the key of the outcomes property.
 12    /// </summary>
 013    public static readonly object OutcomePropertiesKey = new();
 14
 15    /// <summary>
 16    /// Initializes a new instance of the <see cref="OutcomeProxy"/> class.
 17    /// </summary>
 018    public OutcomeProxy(ExpressionExecutionContext expressionExecutionContext)
 19    {
 020        ExpressionExecutionContext = expressionExecutionContext;
 021    }
 22
 023    private ExpressionExecutionContext ExpressionExecutionContext { get; }
 24
 25    /// <summary>
 26    /// Sets the outcome of the current activity.
 27    /// </summary>
 28    /// <param name="outcomeNames">The names of the outcomes.</param>
 29    public void Set(params string[] outcomeNames)
 30    {
 031        ExpressionExecutionContext.TransientProperties[OutcomePropertiesKey] = outcomeNames;
 032    }
 33}