< Summary

Class:Azure.Security.KeyVault.Certificates.CertificateClientOptions
Assembly:Azure.Security.KeyVault.Certificates
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Certificates\src\CertificateClientOptions.cs
Covered lines:10
Uncovered lines:2
Coverable lines:12
Total lines:73
Line coverage:83.3% (10 of 12)
Covered branches:2
Total branches:4
Branch coverage:50% (2 of 4)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Certificates\src\CertificateClientOptions.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.Certificates
 8{
 9    /// <summary>
 10    /// Options that allow you to configure the requests sent to Key Vault.
 11    /// </summary>
 12    public class CertificateClientOptions : 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_1_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.0.
 30            /// </summary>
 31            V7_0 = 0,
 32
 33            /// <summary>
 34            /// The Key Vault API version 7.1-preview.
 35            /// </summary>
 36            V7_1_Preview,
 37#pragma warning restore CA1707 // Identifiers should not contain underscores
 38        }
 39
 40        /// <summary>
 41        /// Gets the <see cref="ServiceVersion"/> of the service API used when
 42        /// making requests. For more information, see
 43        /// <see href="https://docs.microsoft.com/rest/api/keyvault/key-vault-versions">Key Vault versions</see>.
 44        /// </summary>
 17245        public ServiceVersion Version { get; }
 46
 47        /// <summary>
 48        /// Initializes a new instance of the <see cref="CertificateClientOptions"/>
 49        /// class.
 50        /// </summary>
 51        /// <param name="version">
 52        /// The <see cref="ServiceVersion"/> of the service API used when
 53        /// making requests.
 54        /// </param>
 17255        public CertificateClientOptions(ServiceVersion version = LatestVersion)
 56        {
 17257            Version = version;
 58
 17259            this.ConfigureLogging();
 17260        }
 61
 62        internal string GetVersionString()
 63        {
 17264            return Version switch
 17265            {
 066                ServiceVersion.V7_0 => "7.0",
 34467                ServiceVersion.V7_1_Preview => "7.1-preview",
 17268
 069                _ => throw new ArgumentException(Version.ToString()),
 17270            };
 71        }
 72    }
 73}