< Summary

Information
Class: Elsa.Api.Client.Extensions.JsonSerializerOptionsExtensions
Assembly: Elsa.Api.Client
File(s): /home/runner/work/elsa-core/elsa-core/src/clients/Elsa.Api.Client/Extensions/JsonSerializerOptionsExtensions.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 4
Coverable lines: 4
Total lines: 29
Line coverage: 0%
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
WithConverters(...)0%620%
Clone(...)100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/clients/Elsa.Api.Client/Extensions/JsonSerializerOptionsExtensions.cs

#LineLine coverage
 1using System.Text.Json;
 2using System.Text.Json.Serialization;
 3
 4namespace Elsa.Api.Client.Extensions;
 5
 6/// <summary>
 7/// Adds extension methods to <see cref="JsonSerializerOptions"/>.
 8/// </summary>
 9public static class JsonSerializerOptionsExtensions
 10{
 11    /// <summary>
 12    /// Adds the specified converters to the options.
 13    /// </summary>
 14    public static JsonSerializerOptions WithConverters(this JsonSerializerOptions options, params JsonConverter[] conver
 15    {
 016        foreach (var converter in converters)
 017            options.Converters.Add(converter);
 18
 019        return options;
 20    }
 21
 22    /// <summary>
 23    /// Clones the options.
 24    /// </summary>
 25    public static JsonSerializerOptions Clone(this JsonSerializerOptions options)
 26    {
 027        return new(options);
 28    }
 29}