< Summary

Class:Azure.ResourceManager.Resources.Models.AliasPath
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\AliasPath.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\AliasPath.Serialization.cs
Covered lines:26
Uncovered lines:5
Coverable lines:31
Total lines:104
Line coverage:83.8% (26 of 31)
Covered branches:17
Total branches:18
Branch coverage:94.4% (17 of 18)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Path()-100%100%
get_ApiVersions()-0%100%
get_Pattern()-0%100%
DeserializeAliasPath(...)-95.24%94.44%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\AliasPath.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.Resources.Models
 11{
 12    /// <summary> The type of the paths for alias. </summary>
 13    public partial class AliasPath
 14    {
 15        /// <summary> Initializes a new instance of AliasPath. </summary>
 016        internal AliasPath()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of AliasPath. </summary>
 21        /// <param name="path"> The path of an alias. </param>
 22        /// <param name="apiVersions"> The API versions. </param>
 23        /// <param name="pattern"> The pattern for an alias path. </param>
 627224        internal AliasPath(string path, IReadOnlyList<string> apiVersions, AliasPattern pattern)
 25        {
 627226            Path = path;
 627227            ApiVersions = apiVersions;
 627228            Pattern = pattern;
 627229        }
 30
 31        /// <summary> The path of an alias. </summary>
 1232        public string Path { get; }
 33        /// <summary> The API versions. </summary>
 034        public IReadOnlyList<string> ApiVersions { get; }
 35        /// <summary> The pattern for an alias path. </summary>
 036        public AliasPattern Pattern { get; }
 37    }
 38}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\AliasPath.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.Resources.Models
 13{
 14    public partial class AliasPath
 15    {
 16        internal static AliasPath DeserializeAliasPath(JsonElement element)
 17        {
 627218            string path = default;
 627219            IReadOnlyList<string> apiVersions = default;
 627220            AliasPattern pattern = default;
 3769621            foreach (var property in element.EnumerateObject())
 22            {
 1257623                if (property.NameEquals("path"))
 24                {
 627225                    if (property.Value.ValueKind == JsonValueKind.Null)
 26                    {
 27                        continue;
 28                    }
 627229                    path = property.Value.GetString();
 627230                    continue;
 31                }
 630432                if (property.NameEquals("apiVersions"))
 33                {
 627234                    if (property.Value.ValueKind == JsonValueKind.Null)
 35                    {
 36                        continue;
 37                    }
 627238                    List<string> array = new List<string>();
 14147239                    foreach (var item in property.Value.EnumerateArray())
 40                    {
 6446441                        if (item.ValueKind == JsonValueKind.Null)
 42                        {
 043                            array.Add(null);
 44                        }
 45                        else
 46                        {
 6446447                            array.Add(item.GetString());
 48                        }
 49                    }
 627250                    apiVersions = array;
 627251                    continue;
 52                }
 3253                if (property.NameEquals("pattern"))
 54                {
 3255                    if (property.Value.ValueKind == JsonValueKind.Null)
 56                    {
 57                        continue;
 58                    }
 3259                    pattern = AliasPattern.DeserializeAliasPattern(property.Value);
 60                    continue;
 61                }
 62            }
 627263            return new AliasPath(path, apiVersions, pattern);
 64        }
 65    }
 66}