< Summary

Information
Class: Elsa.Workflows.Activity<T>
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Abstractions/ActivityT.cs
Line coverage
30%
Covered lines: 4
Uncovered lines: 9
Coverable lines: 13
Total lines: 43
Line coverage: 30.7%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
.ctor(...)100%210%
.ctor(...)0%620%
.ctor(...)100%210%
get_Result()100%11100%
Elsa.Workflows.IActivityWithResult.get_Result()100%11100%
Elsa.Workflows.IActivityWithResult.set_Result(...)100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Abstractions/ActivityT.cs

#LineLine coverage
 1using Elsa.Expressions.Models;
 2using Elsa.Workflows.Models;
 3
 4namespace Elsa.Workflows;
 5
 6/// <summary>
 7/// Base class for custom activities that return a result.
 8/// </summary>
 9public abstract class Activity<T> : Activity, IActivityWithResult<T>
 10{
 11    /// <inheritdoc />
 71712    protected Activity(string? source = default, int? line = default) : base(source, line)
 13    {
 71714    }
 15
 16    /// <inheritdoc />
 017    protected Activity(string activityType, int version = 1, string? source = default, int? line = default) : base(activ
 18    {
 019    }
 20
 21    /// <inheritdoc />
 022    protected Activity(MemoryBlockReference? output, string? source = default, int? line = default) : this(source, line)
 23    {
 024        if (output != null) Result = new Output<T>(output);
 025    }
 26
 27    /// <inheritdoc />
 028    protected Activity(Output<T>? output, string? source = default, int? line = default) : this(source, line)
 29    {
 030        Result = output;
 031    }
 32
 33    /// <summary>
 34    /// The result of the activity.
 35    /// </summary>
 168636    public Output<T>? Result { get; set; }
 37
 38    Output? IActivityWithResult.Result
 39    {
 1740        get => Result;
 041        set => Result = (Output<T>?)value;
 42    }
 43}