< Summary

Class:Azure.ResourceManager.Storage.Models.RoutingPreference
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\RoutingPreference.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\RoutingPreference.Serialization.cs
Covered lines:21
Uncovered lines:17
Coverable lines:38
Total lines:110
Line coverage:55.2% (21 of 38)
Covered branches:14
Total branches:20
Branch coverage:70% (14 of 20)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_RoutingChoice()-0%100%
get_PublishMicrosoftEndpoints()-0%100%
get_PublishInternetEndpoints()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeRoutingPreference(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\RoutingPreference.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
 8namespace Azure.ResourceManager.Storage.Models
 9{
 10    /// <summary> Routing preference defines the type of network, either microsoft or internet routing to be used to del
 11    public partial class RoutingPreference
 12    {
 13        /// <summary> Initializes a new instance of RoutingPreference. </summary>
 014        public RoutingPreference()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of RoutingPreference. </summary>
 19        /// <param name="routingChoice"> Routing Choice defines the kind of network routing opted by the user. </param>
 20        /// <param name="publishMicrosoftEndpoints"> A boolean flag which indicates whether microsoft routing storage en
 21        /// <param name="publishInternetEndpoints"> A boolean flag which indicates whether internet routing storage endp
 422        internal RoutingPreference(RoutingChoice? routingChoice, bool? publishMicrosoftEndpoints, bool? publishInternetE
 23        {
 424            RoutingChoice = routingChoice;
 425            PublishMicrosoftEndpoints = publishMicrosoftEndpoints;
 426            PublishInternetEndpoints = publishInternetEndpoints;
 427        }
 28
 29        /// <summary> Routing Choice defines the kind of network routing opted by the user. </summary>
 030        public RoutingChoice? RoutingChoice { get; set; }
 31        /// <summary> A boolean flag which indicates whether microsoft routing storage endpoints are to be published. </
 032        public bool? PublishMicrosoftEndpoints { get; set; }
 33        /// <summary> A boolean flag which indicates whether internet routing storage endpoints are to be published. </s
 034        public bool? PublishInternetEndpoints { get; set; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\RoutingPreference.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.ResourceManager.Storage.Models
 12{
 13    public partial class RoutingPreference : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (RoutingChoice != null)
 19            {
 020                writer.WritePropertyName("routingChoice");
 021                writer.WriteStringValue(RoutingChoice.Value.ToString());
 22            }
 023            if (PublishMicrosoftEndpoints != null)
 24            {
 025                writer.WritePropertyName("publishMicrosoftEndpoints");
 026                writer.WriteBooleanValue(PublishMicrosoftEndpoints.Value);
 27            }
 028            if (PublishInternetEndpoints != null)
 29            {
 030                writer.WritePropertyName("publishInternetEndpoints");
 031                writer.WriteBooleanValue(PublishInternetEndpoints.Value);
 32            }
 033            writer.WriteEndObject();
 034        }
 35
 36        internal static RoutingPreference DeserializeRoutingPreference(JsonElement element)
 37        {
 438            RoutingChoice? routingChoice = default;
 439            bool? publishMicrosoftEndpoints = default;
 440            bool? publishInternetEndpoints = default;
 3241            foreach (var property in element.EnumerateObject())
 42            {
 1243                if (property.NameEquals("routingChoice"))
 44                {
 445                    if (property.Value.ValueKind == JsonValueKind.Null)
 46                    {
 47                        continue;
 48                    }
 449                    routingChoice = new RoutingChoice(property.Value.GetString());
 450                    continue;
 51                }
 852                if (property.NameEquals("publishMicrosoftEndpoints"))
 53                {
 454                    if (property.Value.ValueKind == JsonValueKind.Null)
 55                    {
 56                        continue;
 57                    }
 458                    publishMicrosoftEndpoints = property.Value.GetBoolean();
 459                    continue;
 60                }
 461                if (property.NameEquals("publishInternetEndpoints"))
 62                {
 463                    if (property.Value.ValueKind == JsonValueKind.Null)
 64                    {
 65                        continue;
 66                    }
 467                    publishInternetEndpoints = property.Value.GetBoolean();
 68                    continue;
 69                }
 70            }
 471            return new RoutingPreference(routingChoice, publishMicrosoftEndpoints, publishInternetEndpoints);
 72        }
 73    }
 74}