< Summary

Class:Azure.ResourceManager.KeyVault.Models.IPRule
Assembly:Azure.ResourceManager.KeyVault
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\IPRule.cs
C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\IPRule.Serialization.cs
Covered lines:15
Uncovered lines:1
Coverable lines:16
Total lines:68
Line coverage:93.7% (15 of 16)
Covered branches:5
Total branches:6
Branch coverage:83.3% (5 of 6)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-80%50%
get_Value()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeIPRule(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\IPRule.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.KeyVault.Models
 11{
 12    /// <summary> A rule governing the accessibility of a vault from a specific ip address or ip range. </summary>
 13    public partial class IPRule
 14    {
 15        /// <summary> Initializes a new instance of IPRule. </summary>
 16        /// <param name="value"> An IPv4 address range in CIDR notation, such as &apos;124.56.78.91&apos; (simple IP add
 17        /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception>
 20018        public IPRule(string value)
 19        {
 20020            if (value == null)
 21            {
 022                throw new ArgumentNullException(nameof(value));
 23            }
 24
 20025            Value = value;
 20026        }
 27
 28        /// <summary> An IPv4 address range in CIDR notation, such as &apos;124.56.78.91&apos; (simple IP address) or &a
 45629        public string Value { get; set; }
 30    }
 31}

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\IPRule.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.KeyVault.Models
 12{
 13    public partial class IPRule : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 20817            writer.WriteStartObject();
 20818            writer.WritePropertyName("value");
 20819            writer.WriteStringValue(Value);
 20820            writer.WriteEndObject();
 20821        }
 22
 23        internal static IPRule DeserializeIPRule(JsonElement element)
 24        {
 15225            string value = default;
 60826            foreach (var property in element.EnumerateObject())
 27            {
 15228                if (property.NameEquals("value"))
 29                {
 15230                    value = property.Value.GetString();
 31                    continue;
 32                }
 33            }
 15234            return new IPRule(value);
 35        }
 36    }
 37}