< Summary

Class:Azure.Security.KeyVault.Administration.KeyVaultAccessControlClientOptions
Assembly:Azure.Security.KeyVault.Administration
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\KeyVaultAccessControlClientOptions.cs
Covered lines:10
Uncovered lines:1
Coverable lines:11
Total lines:67
Line coverage:90.9% (10 of 11)
Covered branches:1
Total branches:2
Branch coverage:50% (1 of 2)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_Version()-100%100%
.ctor(...)-100%100%
GetVersionString()-83.33%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\KeyVaultAccessControlClientOptions.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using Azure.Core;
 6
 7namespace Azure.Security.KeyVault.Administration
 8{
 9    /// <summary>
 10    /// Options to configure the requests sent to Key Vault.
 11    /// </summary>
 12    public class KeyVaultAccessControlClientOptions : ClientOptions
 13    {
 14        /// <summary>
 15        /// The latest service version supported by this client library.
 16        /// For more information, see
 17        /// <see href="https://docs.microsoft.com/rest/api/keyvault/key-vault-versions">Key Vault versions</see>.
 18        /// </summary>
 19        internal const ServiceVersion LatestVersion = ServiceVersion.V7_2_Preview;
 20
 21        /// <summary>
 22        /// The versions of Azure Key Vault supported by this client
 23        /// library.
 24        /// </summary>
 25        public enum ServiceVersion
 26        {
 27#pragma warning disable CA1707 // Identifiers should not contain underscores
 28            /// <summary>
 29            /// The Key Vault API version 7.2-preview.
 30            /// </summary>
 31            V7_2_Preview = 1,
 32#pragma warning restore CA1707 // Identifiers should not contain underscores
 33        }
 34
 35        /// <summary>
 36        /// Gets the <see cref="ServiceVersion"/> of the service API used when
 37        /// making requests. For more information, see
 38        /// <see href="https://docs.microsoft.com/rest/api/keyvault/key-vault-versions">Key Vault versions</see>.
 39        /// </summary>
 4240        public ServiceVersion Version { get; }
 41
 42        /// <summary>
 43        /// Initializes a new instance of the <see cref="KeyVaultAccessControlClientOptions"/> class.
 44        /// class.
 45        /// </summary>
 46        /// <param name="version">
 47        /// The <see cref="ServiceVersion"/> of the service API used when
 48        /// making requests.
 49        /// </param>
 4250        public KeyVaultAccessControlClientOptions(ServiceVersion version = LatestVersion)
 51        {
 4252            Version = version;
 53
 4254            this.ConfigureLogging();
 4255        }
 56
 57        internal string GetVersionString()
 58        {
 4259            return Version switch
 4260            {
 8461                ServiceVersion.V7_2_Preview => "7.2-preview",
 4262
 063                _ => throw new ArgumentException(Version.ToString()),
 4264            };
 65        }
 66    }
 67}