< Summary

Class:Microsoft.Extensions.Azure.ConfigureClientCredentials`2
Assembly:Microsoft.Extensions.Azure
File(s):C:\Git\azure-sdk-for-net\sdk\core\Microsoft.Extensions.Azure\src\Internal\ConfigureClientCredentials.cs
Covered lines:9
Uncovered lines:1
Coverable lines:10
Total lines:35
Line coverage:90% (9 of 10)
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\ConfigureClientCredentials.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using Azure.Core;
 6using Microsoft.Extensions.Options;
 7
 8namespace Microsoft.Extensions.Azure
 9{
 10    internal class ConfigureClientCredentials<TClient, TOptions> : IConfigureNamedOptions<AzureClientCredentialOptions<T
 11    {
 12        private readonly ClientRegistration<TClient, TOptions> _registration;
 13        private readonly Func<IServiceProvider, TokenCredential> _credentialFactory;
 14
 615        public ConfigureClientCredentials(
 616            ClientRegistration<TClient, TOptions> registration,
 617            Func<IServiceProvider, TokenCredential> credentialFactory)
 18        {
 619            _registration = registration;
 620            _credentialFactory = credentialFactory;
 621        }
 22
 23        public void Configure(AzureClientCredentialOptions<TClient> options)
 24        {
 025        }
 26
 27        public void Configure(string name, AzureClientCredentialOptions<TClient> options)
 28        {
 629            if (name == _registration.Name)
 30            {
 631                options.CredentialFactory = _credentialFactory;
 32            }
 633        }
 34    }
 35}