< Summary

Class:Azure.ResourceManager.Resources.Models.AliasPattern
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\AliasPattern.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\AliasPattern.Serialization.cs
Covered lines:21
Uncovered lines:5
Coverable lines:26
Total lines:89
Line coverage:80.7% (21 of 26)
Covered branches:14
Total branches:14
Branch coverage:100% (14 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Phrase()-0%100%
get_Variable()-0%100%
get_Type()-0%100%
DeserializeAliasPattern(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\AliasPattern.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.Resources.Models
 9{
 10    /// <summary> The type of the pattern for an alias path. </summary>
 11    public partial class AliasPattern
 12    {
 13        /// <summary> Initializes a new instance of AliasPattern. </summary>
 014        internal AliasPattern()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of AliasPattern. </summary>
 19        /// <param name="phrase"> The alias pattern phrase. </param>
 20        /// <param name="variable"> The alias pattern variable. </param>
 21        /// <param name="type"> The type of alias pattern. </param>
 6422        internal AliasPattern(string phrase, string variable, AliasPatternType? type)
 23        {
 6424            Phrase = phrase;
 6425            Variable = variable;
 6426            Type = type;
 6427        }
 28
 29        /// <summary> The alias pattern phrase. </summary>
 030        public string Phrase { get; }
 31        /// <summary> The alias pattern variable. </summary>
 032        public string Variable { get; }
 33        /// <summary> The type of alias pattern. </summary>
 034        public AliasPatternType? Type { get; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\AliasPattern.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.Resources.Models
 12{
 13    public partial class AliasPattern
 14    {
 15        internal static AliasPattern DeserializeAliasPattern(JsonElement element)
 16        {
 6417            string phrase = default;
 6418            string variable = default;
 6419            AliasPatternType? type = default;
 51220            foreach (var property in element.EnumerateObject())
 21            {
 19222                if (property.NameEquals("phrase"))
 23                {
 6424                    if (property.Value.ValueKind == JsonValueKind.Null)
 25                    {
 26                        continue;
 27                    }
 6428                    phrase = property.Value.GetString();
 6429                    continue;
 30                }
 12831                if (property.NameEquals("variable"))
 32                {
 6433                    if (property.Value.ValueKind == JsonValueKind.Null)
 34                    {
 35                        continue;
 36                    }
 6437                    variable = property.Value.GetString();
 6438                    continue;
 39                }
 6440                if (property.NameEquals("type"))
 41                {
 6442                    if (property.Value.ValueKind == JsonValueKind.Null)
 43                    {
 44                        continue;
 45                    }
 6446                    type = property.Value.GetString().ToAliasPatternType();
 47                    continue;
 48                }
 49            }
 6450            return new AliasPattern(phrase, variable, type);
 51        }
 52    }
 53}