< Summary

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

File(s)

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

#LineLine coverage
 1using Elsa.Expressions.Helpers;
 2using Elsa.Expressions.Models;
 3using Elsa.Extensions;
 4// ReSharper disable InconsistentNaming
 5
 6namespace Elsa.Expressions.Python.Models;
 7
 8/// <summary>
 9/// Provides access to activity outputs.
 10/// </summary>
 11public class OutputProxy
 12{
 13    /// <summary>
 14    /// Initializes a new instance of the <see cref="OutputProxy"/> class.
 15    /// </summary>
 016    public OutputProxy(ExpressionExecutionContext expressionExecutionContext)
 17    {
 018        Context = expressionExecutionContext;
 019    }
 20
 21    /// <summary>
 22    /// Gets the expression execution context.
 23    /// </summary>
 024    public ExpressionExecutionContext Context { get; }
 25
 26    /// <summary>
 27    /// Gets the value of the specified output.
 28    /// </summary>
 29    /// <param name="activityIdOrName">The ID or name of the activity that produced the output.</param>
 30    /// <param name="outputName">The name of the output.</param>
 31    /// <returns>The value of the output.</returns>
 032    public object? Get(string activityIdOrName, string? outputName = default) => Context.GetOutput(activityIdOrName, out
 33
 34    /// <summary>
 35    /// Gets the value of the specified output.
 36    /// </summary>
 37    /// <param name="returnType">The type to convert the output value to.</param>
 38    /// <param name="activityIdOrName">The ID or name of the activity that produced the output.</param>
 39    /// <param name="outputName">The name of the output.</param>
 40    /// <returns>The value of the output.</returns>
 041    public object? Get(Type returnType, string activityIdOrName, string? outputName = default) => Get(activityIdOrName, 
 42
 43    /// <summary>
 44    /// Gets the result of the last activity that executed.
 45    /// </summary>
 046    public object? LastResult => Context.GetLastResult();
 47}