< Summary

Class:Azure.ResourceManager.Storage.Models.CustomDomain
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\CustomDomain.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\CustomDomain.Serialization.cs
Covered lines:14
Uncovered lines:15
Coverable lines:29
Total lines:93
Line coverage:48.2% (14 of 29)
Covered branches:3
Total branches:12
Branch coverage:25% (3 of 12)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-80%50%
.ctor(...)-0%100%
get_Name()-100%100%
get_UseSubDomainName()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeCustomDomain(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\CustomDomain.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;
 9
 10namespace Azure.ResourceManager.Storage.Models
 11{
 12    /// <summary> The custom domain assigned to this storage account. This can be set via Update. </summary>
 13    public partial class CustomDomain
 14    {
 15        /// <summary> Initializes a new instance of CustomDomain. </summary>
 16        /// <param name="name"> Gets or sets the custom domain name assigned to the storage account. Name is the CNAME s
 817        public CustomDomain(string name)
 18        {
 819            if (name == null)
 20            {
 021                throw new ArgumentNullException(nameof(name));
 22            }
 23
 824            Name = name;
 825        }
 26
 27        /// <summary> Initializes a new instance of CustomDomain. </summary>
 28        /// <param name="name"> Gets or sets the custom domain name assigned to the storage account. Name is the CNAME s
 29        /// <param name="useSubDomainName"> Indicates whether indirect CName validation is enabled. Default value is fal
 030        internal CustomDomain(string name, bool? useSubDomainName)
 31        {
 032            Name = name;
 033            UseSubDomainName = useSubDomainName;
 034        }
 35
 36        /// <summary> Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. </s
 1637        public string Name { get; set; }
 38        /// <summary> Indicates whether indirect CName validation is enabled. Default value is false. This should only b
 2439        public bool? UseSubDomainName { get; set; }
 40    }
 41}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\CustomDomain.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 CustomDomain : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 817            writer.WriteStartObject();
 818            writer.WritePropertyName("name");
 819            writer.WriteStringValue(Name);
 820            if (UseSubDomainName != null)
 21            {
 822                writer.WritePropertyName("useSubDomainName");
 823                writer.WriteBooleanValue(UseSubDomainName.Value);
 24            }
 825            writer.WriteEndObject();
 826        }
 27
 28        internal static CustomDomain DeserializeCustomDomain(JsonElement element)
 29        {
 030            string name = default;
 031            bool? useSubDomainName = default;
 032            foreach (var property in element.EnumerateObject())
 33            {
 034                if (property.NameEquals("name"))
 35                {
 036                    name = property.Value.GetString();
 037                    continue;
 38                }
 039                if (property.NameEquals("useSubDomainName"))
 40                {
 041                    if (property.Value.ValueKind == JsonValueKind.Null)
 42                    {
 43                        continue;
 44                    }
 045                    useSubDomainName = property.Value.GetBoolean();
 46                    continue;
 47                }
 48            }
 049            return new CustomDomain(name, useSubDomainName);
 50        }
 51    }
 52}