< Summary

Class:Azure.Security.KeyVault.Secrets.SecretClientOptions
Assembly:Azure.Security.KeyVault.Secrets
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Secrets\src\SecretClientOptions.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.Secrets\src\SecretClientOptions.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.Secrets
 8{
 9    /// <summary>
 10    /// Options that allow you to configure the requests sent to Key Vault.
 11    /// </summary>
 12    public class SecretClientOptions : 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 = 1,
 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>
 17845        public ServiceVersion Version { get; }
 46
 47        /// <summary>
 48        /// Initializes a new instance of the <see cref="SecretClientOptions"/> class.
 49        /// class.
 50        /// </summary>
 51        /// <param name="version">
 52        /// The <see cref="ServiceVersion"/> of the service API used when
 53        /// making requests.
 54        /// </param>
 17855        public SecretClientOptions(ServiceVersion version = LatestVersion)
 56        {
 17857            Version = version;
 58
 17859            this.ConfigureLogging();
 17860        }
 61
 62        internal string GetVersionString()
 63        {
 17864            return Version switch
 17865            {
 066                ServiceVersion.V7_0 => "7.0",
 35667                ServiceVersion.V7_1_Preview => "7.1-preview",
 17868
 069                _ => throw new ArgumentException(Version.ToString()),
 17870            };
 71        }
 72    }
 73}