< Summary

Class:Microsoft.Extensions.Azure.ConfigureClientOptions`2
Assembly:Microsoft.Extensions.Azure
File(s):C:\Git\azure-sdk-for-net\sdk\core\Microsoft.Extensions.Azure\src\Internal\ConfigureClientOptions.cs
Covered lines:8
Uncovered lines:1
Coverable lines:9
Total lines:34
Line coverage:88.8% (8 of 9)
Covered branches:2
Total branches:2
Branch coverage:100% (2 of 2)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-100%100%
Configure(...)-0%100%
Configure(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\core\Microsoft.Extensions.Azure\src\Internal\ConfigureClientOptions.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using Microsoft.Extensions.Options;
 6
 7namespace Microsoft.Extensions.Azure
 8{
 9    internal class ConfigureClientOptions<TClient, TOptions> : IConfigureNamedOptions<TOptions> where TOptions : class
 10    {
 11        private readonly IServiceProvider _serviceProvider;
 12        private readonly ClientRegistration<TClient, TOptions> _registration;
 13        private readonly Action<TOptions, IServiceProvider> _configureOptions;
 14
 1215        public ConfigureClientOptions(IServiceProvider serviceProvider, ClientRegistration<TClient, TOptions> registrati
 16        {
 1217            _serviceProvider = serviceProvider;
 1218            _registration = registration;
 1219            _configureOptions = configureOptions;
 1220        }
 21
 22        public void Configure(TOptions options)
 23        {
 024        }
 25
 26        public void Configure(string name, TOptions options)
 27        {
 1628            if (name == _registration.Name)
 29            {
 1230                _configureOptions(options, _serviceProvider);
 31            }
 1632        }
 33    }
 34}