< Summary

Information
Class: System.Net.Http.HttpMessageHandler
Assembly: System.Net.Http
File(s): D:\runner\runtime\src\libraries\System.Net.Http\src\System\Net\Http\HttpMessageHandler.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 12
Coverable lines: 12
Total lines: 43
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor()0%220%
Send(...)100%110%
Dispose(...)100%110%
Dispose()100%110%

File(s)

D:\runner\runtime\src\libraries\System.Net.Http\src\System\Net\Http\HttpMessageHandler.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System;
 5using System.Collections.Generic;
 6using System.Text;
 7using System.Threading;
 8using System.Threading.Tasks;
 9
 10namespace System.Net.Http
 11{
 12    public abstract class HttpMessageHandler : IDisposable
 13    {
 014        protected HttpMessageHandler()
 015        {
 016            if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this);
 017        }
 18
 19        // We cannot add abstract member to a public class in order not to break already established contract of this cl
 20        // So we add virtual method, override it everywhere internally and provide proper implementation.
 21        // Unfortunately we cannot force everyone to implement so in such case we throw NSE.
 22        protected internal virtual HttpResponseMessage Send(HttpRequestMessage request, CancellationToken cancellationTo
 023        {
 024            throw new NotSupportedException(SR.Format(SR.net_http_missing_sync_implementation, GetType(), nameof(HttpMes
 25        }
 26
 27        protected internal abstract Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken ca
 28
 29        #region IDisposable Members
 30
 31        protected virtual void Dispose(bool disposing)
 032        {
 33            // Nothing to do in base class.
 034        }
 35
 36        public void Dispose()
 037        {
 038            Dispose(true);
 039            GC.SuppressFinalize(this);
 040        }
 41        #endregion
 42    }
 43}