< Summary

Class:Azure.ResourceManager.KeyVault.Models.Vault
Assembly:Azure.ResourceManager.KeyVault
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\Vault.cs
C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\Vault.Serialization.cs
Covered lines:41
Uncovered lines:7
Coverable lines:48
Total lines:126
Line coverage:85.4% (41 of 48)
Covered branches:16
Total branches:18
Branch coverage:88.8% (16 of 18)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-100%100%
get_Id()-100%100%
get_Name()-100%100%
get_Type()-0%100%
get_Location()-100%100%
get_Tags()-100%100%
get_Properties()-100%100%
DeserializeVault(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\Vault.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;
 9using System.Collections.Generic;
 10using Azure.Core;
 11
 12namespace Azure.ResourceManager.KeyVault.Models
 13{
 14    /// <summary> Resource information with extended details. </summary>
 15    public partial class Vault
 16    {
 17        /// <summary> Initializes a new instance of Vault. </summary>
 18        /// <param name="properties"> Properties of the vault. </param>
 19        /// <exception cref="ArgumentNullException"> <paramref name="properties"/> is null. </exception>
 020        internal Vault(VaultProperties properties)
 21        {
 022            if (properties == null)
 23            {
 024                throw new ArgumentNullException(nameof(properties));
 25            }
 26
 027            Tags = new ChangeTrackingDictionary<string, string>();
 028            Properties = properties;
 029        }
 30
 31        /// <summary> Initializes a new instance of Vault. </summary>
 32        /// <param name="id"> Fully qualified identifier of the key vault resource. </param>
 33        /// <param name="name"> Name of the key vault resource. </param>
 34        /// <param name="type"> Resource type of the key vault resource. </param>
 35        /// <param name="location"> Azure location of the key vault resource. </param>
 36        /// <param name="tags"> Tags assigned to the key vault resource. </param>
 37        /// <param name="properties"> Properties of the vault. </param>
 7638        internal Vault(string id, string name, string type, string location, IReadOnlyDictionary<string, string> tags, V
 39        {
 7640            Id = id;
 7641            Name = name;
 7642            Type = type;
 7643            Location = location;
 7644            Tags = tags;
 7645            Properties = properties;
 7646        }
 47
 48        /// <summary> Fully qualified identifier of the key vault resource. </summary>
 10849        public string Id { get; }
 50        /// <summary> Name of the key vault resource. </summary>
 7251        public string Name { get; }
 52        /// <summary> Resource type of the key vault resource. </summary>
 053        public string Type { get; }
 54        /// <summary> Azure location of the key vault resource. </summary>
 4855        public string Location { get; }
 56        /// <summary> Tags assigned to the key vault resource. </summary>
 4857        public IReadOnlyDictionary<string, string> Tags { get; }
 58        /// <summary> Properties of the vault. </summary>
 39259        public VaultProperties Properties { get; }
 60    }
 61}

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\Vault.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.KeyVault.Models
 13{
 14    public partial class Vault
 15    {
 16        internal static Vault DeserializeVault(JsonElement element)
 17        {
 7618            Optional<string> id = default;
 7619            Optional<string> name = default;
 7620            Optional<string> type = default;
 7621            Optional<string> location = default;
 7622            Optional<IReadOnlyDictionary<string, string>> tags = default;
 7623            VaultProperties properties = default;
 106424            foreach (var property in element.EnumerateObject())
 25            {
 45626                if (property.NameEquals("id"))
 27                {
 7628                    id = property.Value.GetString();
 7629                    continue;
 30                }
 38031                if (property.NameEquals("name"))
 32                {
 7633                    name = property.Value.GetString();
 7634                    continue;
 35                }
 30436                if (property.NameEquals("type"))
 37                {
 7638                    type = property.Value.GetString();
 7639                    continue;
 40                }
 22841                if (property.NameEquals("location"))
 42                {
 7643                    location = property.Value.GetString();
 7644                    continue;
 45                }
 15246                if (property.NameEquals("tags"))
 47                {
 7648                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 58449                    foreach (var property0 in property.Value.EnumerateObject())
 50                    {
 21651                        dictionary.Add(property0.Name, property0.Value.GetString());
 52                    }
 7653                    tags = dictionary;
 7654                    continue;
 55                }
 7656                if (property.NameEquals("properties"))
 57                {
 7658                    properties = VaultProperties.DeserializeVaultProperties(property.Value);
 59                    continue;
 60                }
 61            }
 7662            return new Vault(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), properties);
 63        }
 64    }
 65}