< Summary

Class:Microsoft.Azure.OperationalInsights.CustomDelegatingHandler
Assembly:Microsoft.Azure.OperationalInsights
File(s):C:\Git\azure-sdk-for-net\sdk\operationalinsights\Microsoft.Azure.OperationalInsights\src\Customized\CustomDelegatingHandler.cs
Covered lines:0
Uncovered lines:10
Coverable lines:10
Total lines:32
Line coverage:0% (0 of 10)
Covered branches:0
Total branches:4
Branch coverage:0% (0 of 4)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_Client()-0%100%
SendAsync()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\operationalinsights\Microsoft.Azure.OperationalInsights\src\Customized\CustomDelegatingHandler.cs

#LineLine coverage
 1using System;
 2using System.Net.Http;
 3using System.Threading;
 4using System.Threading.Tasks;
 5
 6namespace Microsoft.Azure.OperationalInsights
 7{
 8    internal class CustomDelegatingHandler : DelegatingHandler
 9    {
 010        internal OperationalInsightsDataClient Client { get; set; }
 11
 12        internal const string InternalNameHeader = "csharpsdk";
 13
 14        protected async override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cance
 15        {
 016            var appName = InternalNameHeader;
 017            if (!string.IsNullOrWhiteSpace(Client.NameHeader))
 18            {
 019                appName += $",{Client.NameHeader}";
 20            }
 21
 022            request.Headers.Add("prefer", Client.Preferences.ToString());
 023            request.Headers.Add("x-ms-app", appName);
 024            request.Headers.Add("x-ms-client-request-id", Client.RequestId ?? Guid.NewGuid().ToString());
 25
 26            // Call the inner handler.
 027            var response = await base.SendAsync(request, cancellationToken).ConfigureAwait(false);
 28
 029            return response;
 030        }
 31    }
 32}

Methods/Properties

get_Client()
SendAsync()