< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Channels.HttpContextExtensions
Assembly: CoreWCF.Http
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Http/src/CoreWCF/Channels/HttpContextExtensions.cs
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 29
Line coverage: 100%
Branch coverage
100%
Covered branches: 4
Total branches: 4
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
ToWebHeaderCollection(...)100%44100%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Http/src/CoreWCF/Channels/HttpContextExtensions.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.Net;
 5using Microsoft.AspNetCore.Http;
 6
 7namespace CoreWCF.Channels
 8{
 9    internal static class HttpContextExtensions
 10    {
 11        private const string ContentTypeHeaderName = "Content-Type";
 12
 13        internal static WebHeaderCollection ToWebHeaderCollection(this HttpRequest httpRequest)
 14        {
 1315            var webHeaders = new WebHeaderCollection();
 10416            foreach (System.Collections.Generic.KeyValuePair<string, Microsoft.Extensions.Primitives.StringValues> heade
 17            {
 3918                if (header.Key.StartsWith(":")) // HTTP/2 pseudo header, skip as they appear on other properties of Http
 19                    continue;
 20
 3921                webHeaders[header.Key] = header.Value;
 22            }
 23
 1324            webHeaders[ContentTypeHeaderName] = httpRequest.ContentType;
 25
 1326            return webHeaders;
 27        }
 28    }
 29}