< Summary

Class:Microsoft.Extensions.Azure.BlobClientBuilderExtensions
Assembly:Azure.Storage.Blobs
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Blobs\src\BlobClientBuilderExtensions.cs
Covered lines:0
Uncovered lines:6
Coverable lines:6
Total lines:54
Line coverage:0% (0 of 6)
Covered branches:0
Total branches:2
Branch coverage:0% (0 of 2)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Blobs\src\BlobClientBuilderExtensions.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.Storage;
 7using Azure.Storage.Blobs;
 8
 9namespace Microsoft.Extensions.Azure
 10{
 11    /// <summary>
 12    /// Extension methods to add <see cref="BlobServiceClient"/> client to clients builder
 13    /// </summary>
 14    public static class BlobClientBuilderExtensions
 15    {
 16        /// <summary>
 17        /// Registers a <see cref="BlobServiceClient"/> instance with the provided <paramref name="connectionString"/>
 18        /// </summary>
 19        public static IAzureClientBuilder<BlobServiceClient, BlobClientOptions> AddBlobServiceClient<TBuilder>(this TBui
 20            where TBuilder : IAzureClientFactoryBuilder
 21        {
 022            return builder.RegisterClientFactory<BlobServiceClient, BlobClientOptions>(options => new BlobServiceClient(
 23        }
 24
 25        /// <summary>
 26        /// Registers a <see cref="BlobServiceClient"/> instance with the provided <paramref name="serviceUri"/>
 27        /// </summary>
 28        public static IAzureClientBuilder<BlobServiceClient, BlobClientOptions> AddBlobServiceClient<TBuilder>(this TBui
 29            where TBuilder : IAzureClientFactoryBuilderWithCredential
 30        {
 031            return builder.RegisterClientFactory<BlobServiceClient, BlobClientOptions>(
 032                (options, token) => token != null ? new BlobServiceClient(serviceUri, token, options) : new BlobServiceC
 033                requiresCredential: false);
 34        }
 35
 36        /// <summary>
 37        /// Registers a <see cref="BlobServiceClient"/> instance with the provided <paramref name="serviceUri"/> and <pa
 38        /// </summary>
 39        public static IAzureClientBuilder<BlobServiceClient, BlobClientOptions> AddBlobServiceClient<TBuilder>(this TBui
 40            where TBuilder : IAzureClientFactoryBuilder
 41        {
 042            return builder.RegisterClientFactory<BlobServiceClient, BlobClientOptions>(options => new BlobServiceClient(
 43        }
 44
 45        /// <summary>
 46        /// Registers a <see cref="BlobServiceClient"/> instance with connection options loaded from the provided <param
 47        /// </summary>
 48        public static IAzureClientBuilder<BlobServiceClient, BlobClientOptions> AddBlobServiceClient<TBuilder, TConfigur
 49            where TBuilder : IAzureClientFactoryBuilderWithConfiguration<TConfiguration>
 50        {
 051            return builder.RegisterClientFactory<BlobServiceClient, BlobClientOptions>(configuration);
 52        }
 53    }
 54}