< Summary

Class:Microsoft.Extensions.Azure.KeyClientBuilderExtensions
Assembly:Azure.Security.KeyVault.Keys
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Keys\src\KeyClientBuilderExtensions.cs
Covered lines:0
Uncovered lines:4
Coverable lines:4
Total lines:52
Line coverage:0% (0 of 4)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
AddKeyClient(...)-0%100%
AddKeyClient(...)-0%100%
AddCryptographyClient(...)-0%100%
AddCryptographyClient(...)-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Keys\src\KeyClientBuilderExtensions.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using Azure.Core.Extensions;
 6using Azure.Security.KeyVault.Keys;
 7using Azure.Security.KeyVault.Keys.Cryptography;
 8
 9namespace Microsoft.Extensions.Azure
 10{
 11    /// <summary>
 12    /// Extension methods to <see cref="KeyClient"/> or <see cref="CryptographyClient"/> to clients builder.
 13    /// </summary>
 14    public static class KeyClientBuilderExtensions
 15    {
 16        /// <summary>
 17        /// Registers a <see cref="KeyClient"/> instance with the provided <paramref name="vaultUri"/>
 18        /// </summary>
 19        public static IAzureClientBuilder<KeyClient, KeyClientOptions> AddKeyClient<TBuilder>(this TBuilder builder, Uri
 20            where TBuilder : IAzureClientFactoryBuilderWithCredential
 21        {
 022            return builder.RegisterClientFactory<KeyClient, KeyClientOptions>((options, cred) => new KeyClient(vaultUri,
 23        }
 24
 25        /// <summary>
 26        /// Registers a <see cref="KeyClient"/> instance with connection options loaded from the provided <paramref name
 27        /// </summary>
 28        public static IAzureClientBuilder<KeyClient, KeyClientOptions> AddKeyClient<TBuilder, TConfiguration>(this TBuil
 29            where TBuilder : IAzureClientFactoryBuilderWithConfiguration<TConfiguration>
 30        {
 031            return builder.RegisterClientFactory<KeyClient, KeyClientOptions>(configuration);
 32        }
 33
 34        /// <summary>
 35        /// Registers a <see cref="KeyClient"/> instance with the provided <paramref name="vaultUri"/>
 36        /// </summary>
 37        public static IAzureClientBuilder<CryptographyClient, CryptographyClientOptions> AddCryptographyClient<TBuilder>
 38            where TBuilder : IAzureClientFactoryBuilderWithCredential
 39        {
 040            return builder.RegisterClientFactory<CryptographyClient, CryptographyClientOptions>((options, cred) => new C
 41        }
 42
 43        /// <summary>
 44        /// Registers a <see cref="KeyClient"/> instance with connection options loaded from the provided <paramref name
 45        /// </summary>
 46        public static IAzureClientBuilder<CryptographyClient, CryptographyClientOptions> AddCryptographyClient<TBuilder,
 47            where TBuilder : IAzureClientFactoryBuilderWithConfiguration<TConfiguration>
 48        {
 049            return builder.RegisterClientFactory<CryptographyClient, CryptographyClientOptions>(configuration);
 50        }
 51    }
 52}