< Summary

Class:Microsoft.Azure.ApplicationInsights.Query.CustomDelegatingHandler
Assembly:Microsoft.Azure.ApplicationInsights.Query
File(s):C:\Git\azure-sdk-for-net\sdk\applicationinsights\Microsoft.Azure.ApplicationInsights.Query\src\Customized\CustomDelegatingHandler.cs
Covered lines:0
Uncovered lines:10
Coverable lines:10
Total lines:35
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\applicationinsights\Microsoft.Azure.ApplicationInsights.Query\src\Customized\CustomDelegatingHandler.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.Linq;
 4using System.Net.Http;
 5using System.Text;
 6using System.Threading;
 7using System.Threading.Tasks;
 8
 9namespace Microsoft.Azure.ApplicationInsights.Query
 10{
 11    internal class CustomDelegatingHandler : DelegatingHandler
 12    {
 013        internal ApplicationInsightsDataClient Client { get; set; }
 14
 15        internal const string InternalNameHeader = "csharpsdk";
 16
 17        protected async override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cance
 18        {
 019            var appName = InternalNameHeader;
 020            if (!string.IsNullOrWhiteSpace(Client.NameHeader))
 21            {
 022                appName += $",{Client.NameHeader}";
 23            }
 24
 025            request.Headers.Add("prefer", Client.Preferences.ToString());
 026            request.Headers.Add("x-ms-app", appName);
 027            request.Headers.Add("x-ms-client-request-id", Client.RequestId ?? Guid.NewGuid().ToString());
 28
 29            // Call the inner handler.
 030            var response = await base.SendAsync(request, cancellationToken).ConfigureAwait(false);
 31
 032            return response;
 033        }
 34    }
 35}

Methods/Properties

get_Client()
SendAsync()