< Summary

Information
Class: Elsa.Workflows.Serialization.Converters.JsonIgnoreCompositeRootConverterFactory
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Serialization/Converters/JsonIgnoreCompositeRootConverterFactory.cs
Line coverage
100%
Covered lines: 3
Uncovered lines: 0
Coverable lines: 3
Total lines: 20
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%
CanConvert(...)100%11100%
CreateConverter(...)100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Serialization/Converters/JsonIgnoreCompositeRootConverterFactory.cs

#LineLine coverage
 1using System.Text.Json;
 2using System.Text.Json.Serialization;
 3using Elsa.Workflows.Serialization.Helpers;
 4
 5namespace Elsa.Workflows.Serialization.Converters;
 6
 7/// <summary>
 8/// A <see cref="JsonConverterFactory"/> that creates <see cref="JsonIgnoreCompositeRootConverter"/> instances.
 9/// </summary>
 115010public class JsonIgnoreCompositeRootConverterFactory(ActivityWriter activityWriter) : JsonConverterFactory
 11{
 12    /// <inheritdoc />
 9510713    public override bool CanConvert(Type typeToConvert) => typeof(IActivity).IsAssignableFrom(typeToConvert);
 14
 15    /// <inheritdoc />
 16    public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options)
 17    {
 127218        return new JsonIgnoreCompositeRootConverter(activityWriter);
 19    }
 20}