< Summary

Information
Class: Elsa.Expressions.Models.Literal<T>
Assembly: Elsa.Expressions
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Expressions/Models/Literal.cs
Line coverage
50%
Covered lines: 2
Uncovered lines: 2
Coverable lines: 4
Total lines: 48
Line coverage: 50%
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%
.ctor(...)100%11100%

File(s)

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

#LineLine coverage
 1namespace Elsa.Expressions.Models;
 2
 3/// <summary>
 4/// A literal expression that represents a constant value.
 5/// </summary>
 6public class Literal : MemoryBlockReference
 7{
 8    /// <inheritdoc />
 9    public Literal()
 10    {
 11    }
 12
 13    /// <inheritdoc />
 14    public Literal(object? value, string? id = null) : base(id!)
 15    {
 16        Value = value;
 17    }
 18
 19    /// <summary>
 20    /// Gets the value of the literal.
 21    /// </summary>
 22    public object? Value { get; }
 23
 24    /// <summary>
 25    /// Creates a literal expression from a value.
 26    /// </summary>
 27    /// <param name="value">The value.</param>
 28    /// <typeparam name="T">The value type.</typeparam>
 29    /// <returns>A literal expression.</returns>
 30    public static Literal From<T>(T value) => new Literal<T>(value);
 31}
 32
 33/// <summary>
 34/// A literal expression that represents a constant value.
 35/// </summary>
 36/// <typeparam name="T">The value type.</typeparam>
 37public class Literal<T> : Literal
 38{
 39    /// <inheritdoc />
 040    public Literal()
 41    {
 042    }
 43
 44    /// <inheritdoc />
 310545    public Literal(T value, string? id = null) : base(value!, id)
 46    {
 310547    }
 48}

Methods/Properties

.ctor()
.ctor(T,System.String)