< Summary

Class:Azure.Data.AppConfiguration.ConfigurationClientOptions
Assembly:Azure.Data.AppConfiguration
File(s):C:\Git\azure-sdk-for-net\sdk\appconfiguration\Azure.Data.AppConfiguration\src\ConfigurationClientOptions.cs
Covered lines:7
Uncovered lines:1
Coverable lines:8
Total lines:65
Line coverage:87.5% (7 of 8)
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()-66.67%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\appconfiguration\Azure.Data.AppConfiguration\src\ConfigurationClientOptions.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using Azure.Core;
 6using Azure.Core.Pipeline;
 7
 8namespace Azure.Data.AppConfiguration
 9{
 10    /// <summary>
 11    /// Options that allow users to configure the requests sent to the App Configuration service.
 12    /// </summary>
 13    public class ConfigurationClientOptions : ClientOptions
 14    {
 15        /// <summary>
 16        /// The latest service version supported by this client library.
 17        /// </summary>
 18        internal const ServiceVersion LatestVersion = ServiceVersion.V1_0;
 19
 20        /// <summary>
 21        /// The versions of the App Configuration service supported by this client library.
 22        /// </summary>
 23        public enum ServiceVersion
 24        {
 25#pragma warning disable CA1707 // Identifiers should not contain underscores
 26            /// <summary>
 27            /// Version 1.0.
 28            /// </summary>
 29            V1_0 = 0
 30#pragma warning restore CA1707 // Identifiers should not contain underscores
 31        }
 32
 33        /// <summary>
 34        /// Gets the <see cref="ServiceVersion"/> of the service API used when
 35        /// making requests.
 36        /// </summary>
 32637        internal ServiceVersion Version { get; }
 38
 39        /// <summary>
 40        /// Initializes a new instance of the <see cref="ConfigurationClientOptions"/>
 41        /// class.
 42        /// </summary>
 43        /// <param name="version">
 44        /// The <see cref="ServiceVersion"/> of the service API used when
 45        /// making requests.
 46        /// </param>
 32647        public ConfigurationClientOptions(ServiceVersion version = LatestVersion)
 48        {
 32649            Version = version;
 32650            this.ConfigureLogging();
 32651        }
 52
 53        internal string GetVersionString()
 54        {
 32655            switch (Version)
 56            {
 57                case ServiceVersion.V1_0:
 32658                    return "1.0";
 59
 60                default:
 061                    throw new ArgumentException(Version.ToString());
 62            }
 63        }
 64    }
 65}