< Summary

Information
Class: Elsa.Workflows.Serialization.Converters.ExpandoObjectConverterFactory
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Serialization/Converters/ExpandoObjectConverterFactory.cs
Line coverage
66%
Covered lines: 2
Uncovered lines: 1
Coverable lines: 3
Total lines: 24
Line coverage: 66.6%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
CanConvert(...)50%3250%
CreateConverter(...)100%11100%

File(s)

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

#LineLine coverage
 1using System.Text.Json;
 2using System.Text.Json.Serialization;
 3
 4namespace Elsa.Workflows.Serialization.Converters;
 5
 6/// <summary>
 7/// A JSON converter factory that creates <see cref="ExpandoObjectConverter"/> instances.
 8/// </summary>
 9public class ExpandoObjectConverterFactory : JsonConverterFactory
 10{
 11    /// <inheritdoc />
 12    public override bool CanConvert(Type typeToConvert)
 13    {
 85214        var canConvert = typeToConvert.IsClass && typeToConvert == typeof(object);
 15
 016        return canConvert;
 17    }
 18
 19    /// <inheritdoc />
 20    public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options)
 21    {
 2222        return new ExpandoObjectConverter();
 23    }
 24}