< Summary

Class:Azure.Core.Pipeline.ClientRequestIdPolicy
Assembly:Azure.Core
File(s):C:\Git\azure-sdk-for-net\sdk\core\Azure.Core\src\Pipeline\Internal\ClientRequestIdPolicy.cs
Covered lines:6
Uncovered lines:0
Coverable lines:6
Total lines:23
Line coverage:100% (6 of 6)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
get_Shared()-100%100%
OnSendingRequest(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\core\Azure.Core\src\Pipeline\Internal\ClientRequestIdPolicy.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4namespace Azure.Core.Pipeline
 5{
 6    internal class ClientRequestIdPolicy : HttpPipelineSynchronousPolicy
 7    {
 8        internal const string ClientRequestIdHeader = "x-ms-client-request-id";
 9        internal const string EchoClientRequestId = "x-ms-return-client-request-id";
 10
 211        protected ClientRequestIdPolicy()
 12        {
 213        }
 14
 6015        public static ClientRequestIdPolicy Shared { get; } = new ClientRequestIdPolicy();
 16
 17        public override void OnSendingRequest(HttpMessage message)
 18        {
 163819            message.Request.Headers.SetValue(ClientRequestIdHeader, message.Request.ClientRequestId);
 163820            message.Request.Headers.SetValue(EchoClientRequestId, "true");
 163821        }
 22    }
 23}