< Summary

Class:Azure.ResourceManager.Compute.Models.ReplicationStatus
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ReplicationStatus.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ReplicationStatus.Serialization.cs
Covered lines:20
Uncovered lines:16
Coverable lines:36
Total lines:111
Line coverage:55.5% (20 of 36)
Covered branches:13
Total branches:20
Branch coverage:65% (13 of 20)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_AggregatedState()-0%100%
get_Summary()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeReplicationStatus(...)-93.75%92.86%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ReplicationStatus.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System.Collections.Generic;
 9
 10namespace Azure.ResourceManager.Compute.Models
 11{
 12    /// <summary> This is the replication status of the gallery Image Version. </summary>
 13    public partial class ReplicationStatus
 14    {
 15        /// <summary> Initializes a new instance of ReplicationStatus. </summary>
 016        public ReplicationStatus()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of ReplicationStatus. </summary>
 21        /// <param name="aggregatedState"> This is the aggregated replication status based on all the regional replicati
 22        /// <param name="summary"> This is a summary of replication status for each region. </param>
 1223        internal ReplicationStatus(AggregatedReplicationState? aggregatedState, IList<RegionalReplicationStatus> summary
 24        {
 1225            AggregatedState = aggregatedState;
 1226            Summary = summary;
 1227        }
 28
 29        /// <summary> This is the aggregated replication status based on all the regional replication status flags. </su
 030        public AggregatedReplicationState? AggregatedState { get; }
 31        /// <summary> This is a summary of replication status for each region. </summary>
 432        public IList<RegionalReplicationStatus> Summary { get; }
 33    }
 34}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ReplicationStatus.Serialization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.ResourceManager.Compute.Models
 13{
 14    public partial class ReplicationStatus : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (AggregatedState != null)
 20            {
 021                writer.WritePropertyName("aggregatedState");
 022                writer.WriteStringValue(AggregatedState.Value.ToString());
 23            }
 024            if (Summary != null)
 25            {
 026                writer.WritePropertyName("summary");
 027                writer.WriteStartArray();
 028                foreach (var item in Summary)
 29                {
 030                    writer.WriteObjectValue(item);
 31                }
 032                writer.WriteEndArray();
 33            }
 034            writer.WriteEndObject();
 035        }
 36
 37        internal static ReplicationStatus DeserializeReplicationStatus(JsonElement element)
 38        {
 1239            AggregatedReplicationState? aggregatedState = default;
 1240            IList<RegionalReplicationStatus> summary = default;
 7241            foreach (var property in element.EnumerateObject())
 42            {
 2443                if (property.NameEquals("aggregatedState"))
 44                {
 1245                    if (property.Value.ValueKind == JsonValueKind.Null)
 46                    {
 47                        continue;
 48                    }
 1249                    aggregatedState = new AggregatedReplicationState(property.Value.GetString());
 1250                    continue;
 51                }
 1252                if (property.NameEquals("summary"))
 53                {
 1254                    if (property.Value.ValueKind == JsonValueKind.Null)
 55                    {
 56                        continue;
 57                    }
 1258                    List<RegionalReplicationStatus> array = new List<RegionalReplicationStatus>();
 4859                    foreach (var item in property.Value.EnumerateArray())
 60                    {
 1261                        if (item.ValueKind == JsonValueKind.Null)
 62                        {
 063                            array.Add(null);
 64                        }
 65                        else
 66                        {
 1267                            array.Add(RegionalReplicationStatus.DeserializeRegionalReplicationStatus(item));
 68                        }
 69                    }
 1270                    summary = array;
 71                    continue;
 72                }
 73            }
 1274            return new ReplicationStatus(aggregatedState, summary);
 75        }
 76    }
 77}