< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ProcessNextAsync(...)-100%100%
ProcessNext(...)-100%100%

File(s)

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

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4#nullable enable
 5
 6using System;
 7using System.Threading.Tasks;
 8
 9namespace Azure.Core.Pipeline
 10{
 11    /// <summary>
 12    /// Represent an extension point for the <see cref="HttpPipeline"/> that can mutate the <see cref="Request"/> and re
 13    /// </summary>
 14    public abstract class HttpPipelinePolicy
 15    {
 16        /// <summary>
 17        /// Applies the policy to the <paramref name="message"/>. Implementers are expected to mutate <see cref="HttpMes
 18        /// </summary>
 19        /// <param name="message">The <see cref="HttpMessage"/> this policy would be applied to.</param>
 20        /// <param name="pipeline">The set of <see cref="HttpPipelinePolicy"/> to execute after current one.</param>
 21        /// <returns>The <see cref="ValueTask"/> representing the asynchronous operation.</returns>
 22        public abstract ValueTask ProcessAsync(HttpMessage message, ReadOnlyMemory<HttpPipelinePolicy> pipeline);
 23
 24        /// <summary>
 25        /// Applies the policy to the <paramref name="message"/>. Implementers are expected to mutate <see cref="HttpMes
 26        /// </summary>
 27        /// <param name="message">The <see cref="HttpMessage"/> this policy would be applied to.</param>
 28        /// <param name="pipeline">The set of <see cref="HttpPipelinePolicy"/> to execute after current one.</param>
 29        public abstract void Process(HttpMessage message, ReadOnlyMemory<HttpPipelinePolicy> pipeline);
 30
 31        /// <summary>
 32        /// Invokes the next <see cref="HttpPipelinePolicy"/> in the <paramref name="pipeline"/>.
 33        /// </summary>
 34        /// <param name="message">The <see cref="HttpMessage"/> next policy would be applied to.</param>
 35        /// <param name="pipeline">The set of <see cref="HttpPipelinePolicy"/> to execute after next one.</param>
 36        /// <returns>The <see cref="ValueTask"/> representing the asynchronous operation.</returns>
 37        protected static ValueTask ProcessNextAsync(HttpMessage message, ReadOnlyMemory<HttpPipelinePolicy> pipeline)
 38        {
 716639            return pipeline.Span[0].ProcessAsync(message, pipeline.Slice(1));
 40        }
 41
 42        /// <summary>
 43        /// Invokes the next <see cref="HttpPipelinePolicy"/> in the <paramref name="pipeline"/>.
 44        /// </summary>
 45        /// <param name="message">The <see cref="HttpMessage"/> next policy would be applied to.</param>
 46        /// <param name="pipeline">The set of <see cref="HttpPipelinePolicy"/> to execute after next one.</param>
 47        protected static void ProcessNext(HttpMessage message, ReadOnlyMemory<HttpPipelinePolicy> pipeline)
 48        {
 702049            pipeline.Span[0].Process(message, pipeline.Slice(1));
 695050        }
 51    }
 52}