< Summary

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

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Expressions.Python/Models/InputProxy.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/// A wrapper for accessing activity input values from Python.
 10/// </summary>
 11public class InputProxy
 12{
 13    /// <summary>
 14    /// Initializes a new instance of the <see cref="InputProxy"/> class.
 15    /// </summary>
 016    public InputProxy(ExpressionExecutionContext context)
 17    {
 018        Context = context;
 019    }
 20
 21    /// <summary>
 22    /// Gets the expression execution context.
 23    /// </summary>
 024    public ExpressionExecutionContext Context { get; set; }
 25
 26    /// <summary>
 27    /// Gets the value of the specified input.
 28    /// </summary>
 029    public object? Get(string name) => Context.GetInput(name);
 30
 31    /// <summary>
 32    /// Gets the value of the specified input.
 33    /// </summary>
 034    public object? Get(Type type, string name) => Context.GetInput(name).ConvertTo(type);
 35}