< Summary

Class:Azure.ResourceManager.Network.Models.MatchVariable
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\MatchVariable.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\MatchVariable.Serialization.cs
Covered lines:0
Uncovered lines:27
Coverable lines:27
Total lines:86
Line coverage:0% (0 of 27)
Covered branches:0
Total branches:10
Branch coverage:0% (0 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%100%
.ctor(...)-0%100%
get_VariableName()-0%100%
get_Selector()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeMatchVariable(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\MatchVariable.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.Network.Models
 9{
 10    /// <summary> Define match variables. </summary>
 11    public partial class MatchVariable
 12    {
 13        /// <summary> Initializes a new instance of MatchVariable. </summary>
 14        /// <param name="variableName"> Match Variable. </param>
 015        public MatchVariable(WebApplicationFirewallMatchVariable variableName)
 16        {
 017            VariableName = variableName;
 018        }
 19
 20        /// <summary> Initializes a new instance of MatchVariable. </summary>
 21        /// <param name="variableName"> Match Variable. </param>
 22        /// <param name="selector"> The selector of match variable. </param>
 023        internal MatchVariable(WebApplicationFirewallMatchVariable variableName, string selector)
 24        {
 025            VariableName = variableName;
 026            Selector = selector;
 027        }
 28
 29        /// <summary> Match Variable. </summary>
 030        public WebApplicationFirewallMatchVariable VariableName { get; set; }
 31        /// <summary> The selector of match variable. </summary>
 032        public string Selector { get; set; }
 33    }
 34}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\MatchVariable.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.Network.Models
 12{
 13    public partial class MatchVariable : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("variableName");
 019            writer.WriteStringValue(VariableName.ToString());
 020            if (Selector != null)
 21            {
 022                writer.WritePropertyName("selector");
 023                writer.WriteStringValue(Selector);
 24            }
 025            writer.WriteEndObject();
 026        }
 27
 28        internal static MatchVariable DeserializeMatchVariable(JsonElement element)
 29        {
 030            WebApplicationFirewallMatchVariable variableName = default;
 031            string selector = default;
 032            foreach (var property in element.EnumerateObject())
 33            {
 034                if (property.NameEquals("variableName"))
 35                {
 036                    variableName = new WebApplicationFirewallMatchVariable(property.Value.GetString());
 037                    continue;
 38                }
 039                if (property.NameEquals("selector"))
 40                {
 041                    if (property.Value.ValueKind == JsonValueKind.Null)
 42                    {
 43                        continue;
 44                    }
 045                    selector = property.Value.GetString();
 46                    continue;
 47                }
 48            }
 049            return new MatchVariable(variableName, selector);
 50        }
 51    }
 52}