< Summary

Information
Class: Elsa.Workflows.Serialization.Converters.RootActivityNodeConverter
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Serialization/Converters/RootActivityNodeConverter.cs
Line coverage
88%
Covered lines: 8
Uncovered lines: 1
Coverable lines: 9
Total lines: 29
Line coverage: 88.8%
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%
Write(...)100%11100%
Read(...)100%210%

File(s)

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

#LineLine coverage
 1using System.Text.Json;
 2using System.Text.Json.Serialization;
 3using Elsa.Workflows.Models;
 4using Elsa.Workflows.Serialization.Helpers;
 5
 6namespace Elsa.Workflows.Serialization.Converters;
 7
 8/// <summary>
 9/// Serializes the <see cref="ActivityNode"/> type without its children. Instead, it will serialize the activity childre
 10/// </summary>
 111public class RootActivityNodeConverter(ActivityWriter activityWriter, bool excludeChildren = false) : JsonConverter<Acti
 12{
 13    /// <inheritdoc />
 14    public override void Write(Utf8JsonWriter writer, ActivityNode value, JsonSerializerOptions options)
 15    {
 116        writer.WriteStartObject();
 117        writer.WriteString("nodeId", value.NodeId);
 118        writer.WriteString("port", value.Port);
 119        writer.WritePropertyName("activity");
 120        activityWriter.WriteActivity(writer, value.Activity, options, excludeChildren: excludeChildren);
 121        writer.WriteEndObject();
 122    }
 23
 24    /// <inheritdoc />
 25    public override ActivityNode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
 26    {
 027        throw new NotImplementedException();
 28    }
 29}