< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
Process(...)-100%100%
ProcessAsync()-100%100%
OnSendingRequest(...)-100%100%
OnReceivedResponse(...)-100%100%

File(s)

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

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using System.Threading.Tasks;
 6
 7namespace Azure.Core.Pipeline
 8{
 9    /// <summary>
 10    /// Represents a <see cref="HttpPipelinePolicy"/> that doesn't do any asynchronous or synchronously blocking operati
 11    /// </summary>
 12    public abstract class HttpPipelineSynchronousPolicy : HttpPipelinePolicy
 13    {
 14        /// <inheritdoc />
 15        public override void Process(HttpMessage message, ReadOnlyMemory<HttpPipelinePolicy> pipeline)
 16        {
 243617            OnSendingRequest(message);
 243618            ProcessNext(message, pipeline);
 243019            OnReceivedResponse(message);
 243020        }
 21
 22        /// <inheritdoc />
 23        public override async ValueTask ProcessAsync(HttpMessage message, ReadOnlyMemory<HttpPipelinePolicy> pipeline)
 24        {
 250625            OnSendingRequest(message);
 250626            await ProcessNextAsync(message, pipeline).ConfigureAwait(false);
 250027            OnReceivedResponse(message);
 250028        }
 29
 30        /// <summary>
 31        /// Method is invoked before the request is sent.
 32        /// </summary>
 33        /// <param name="message">The <see cref="HttpMessage" /> containing the request.</param>
 834        public virtual void OnSendingRequest(HttpMessage message) { }
 35
 36        /// <summary>
 37        /// Method is invoked after the response is received.
 38        /// </summary>
 39        /// <param name="message">The <see cref="HttpMessage" /> containing the response.</param>
 492840        public virtual void OnReceivedResponse(HttpMessage message) { }
 41    }
 42}