< Summary

Information
Class: Elsa.Workflows.Serialization.ReferenceHandlers.CrossScopedReferenceHandler
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Serialization/ReferenceHandlers/CrossScopedReferenceHandler.cs
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 27
Line coverage: 100%
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%11100%
CreateResolver()100%11100%
Reset()100%11100%
GetResolver()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Serialization/ReferenceHandlers/CrossScopedReferenceHandler.cs

#LineLine coverage
 1using System.Text.Json.Serialization;
 2
 3namespace Elsa.Workflows.Serialization.ReferenceHandlers;
 4
 5/// <summary>
 6/// A reference handler that can be used to resolve references across scopes.
 7/// </summary>
 8public class CrossScopedReferenceHandler : ReferenceHandler
 9{
 10    /// <inheritdoc />
 88811    public CrossScopedReferenceHandler() => Reset();
 12    private ReferenceResolver? _rootedResolver;
 13
 14    /// <inheritdoc />
 93315    public override ReferenceResolver CreateResolver() => _rootedResolver!;
 16
 17    /// <summary>
 18    /// Resets the reference resolver.
 19    /// </summary>
 44420    public void Reset() => _rootedResolver = new CustomPreserveReferenceResolver();
 21
 22    /// <summary>
 23    /// Gets the reference resolver.
 24    /// </summary>
 25    /// <returns>The reference resolver.</returns>
 10226    public ReferenceResolver GetResolver() => _rootedResolver!;
 27}