< Summary

Class:Azure.ResourceManager.KeyVault.Models.VaultCreateOrUpdateParameters
Assembly:Azure.ResourceManager.KeyVault
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\VaultCreateOrUpdateParameters.cs
C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\VaultCreateOrUpdateParameters.Serialization.cs
Covered lines:24
Uncovered lines:2
Coverable lines:26
Total lines:80
Line coverage:92.3% (24 of 26)
Covered branches:6
Total branches:8
Branch coverage:75% (6 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-77.78%50%
get_Location()-100%100%
get_Tags()-100%100%
get_Properties()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\VaultCreateOrUpdateParameters.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> Parameters for creating or updating a vault. </summary>
 15    public partial class VaultCreateOrUpdateParameters
 16    {
 17        /// <summary> Initializes a new instance of VaultCreateOrUpdateParameters. </summary>
 18        /// <param name="location"> The supported Azure location where the key vault should be created. </param>
 19        /// <param name="properties"> Properties of the vault. </param>
 20        /// <exception cref="ArgumentNullException"> <paramref name="location"/> or <paramref name="properties"/> is nul
 4421        public VaultCreateOrUpdateParameters(string location, VaultProperties properties)
 22        {
 4423            if (location == null)
 24            {
 025                throw new ArgumentNullException(nameof(location));
 26            }
 4427            if (properties == null)
 28            {
 029                throw new ArgumentNullException(nameof(properties));
 30            }
 31
 4432            Location = location;
 4433            Tags = new ChangeTrackingDictionary<string, string>();
 4434            Properties = properties;
 4435        }
 36
 37        /// <summary> The supported Azure location where the key vault should be created. </summary>
 10438        public string Location { get; }
 39        /// <summary> The tags that will be assigned to the key vault. </summary>
 24040        public IDictionary<string, string> Tags { get; }
 41        /// <summary> Properties of the vault. </summary>
 10442        public VaultProperties Properties { get; }
 43    }
 44}

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\VaultCreateOrUpdateParameters.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 VaultCreateOrUpdateParameters : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 10417            writer.WriteStartObject();
 10418            writer.WritePropertyName("location");
 10419            writer.WriteStringValue(Location);
 10420            if (Optional.IsCollectionDefined(Tags))
 21            {
 9622                writer.WritePropertyName("tags");
 9623                writer.WriteStartObject();
 76824                foreach (var item in Tags)
 25                {
 28826                    writer.WritePropertyName(item.Key);
 28827                    writer.WriteStringValue(item.Value);
 28                }
 9629                writer.WriteEndObject();
 30            }
 10431            writer.WritePropertyName("properties");
 10432            writer.WriteObjectValue(Properties);
 10433            writer.WriteEndObject();
 10434        }
 35    }
 36}