< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Configuration.NetFramingServiceCollectionExtensions
Assembly: CoreWCF.NetFramingBase
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.NetFramingBase/src/CoreWCF/Configuration/NetFramingServiceCollectionExtensions.cs
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 27
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
AddNetFramingServices(...)100%11100%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.NetFramingBase/src/CoreWCF/Configuration/NetFramingServiceCollectionExtensions.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.Collections.Generic;
 5using CoreWCF.Channels;
 6using CoreWCF.Channels.Framing;
 7using Microsoft.Extensions.DependencyInjection;
 8using Microsoft.Extensions.DependencyInjection.Extensions;
 9
 10namespace CoreWCF.Configuration
 11{
 12    public static class NetFramingServiceCollectionExtensions
 13    {
 14        public static IServiceCollection AddNetFramingServices(this IServiceCollection services)
 15        {
 8316            services.TryAddSingleton<NetMessageFramingConnectionHandler>();
 8317            services.TryAddSingleton(NetMessageFramingConnectionHandler.BuildAddressTable);
 18            // NetNamedPipeHostedService.StartAsync needs to trigger building the address table, but the
 19            // UriPrefixTable type that exists in NetFramingBase is internal, so we also register it as
 20            // its implemented interface type as an alias to be able to resolve it.
 8321            services.TryAddSingleton<IEnumerable<KeyValuePair<BaseUriWithWildcard, HandshakeDelegate>>>(services =>
 8322                services.GetRequiredService<UriPrefixTable<HandshakeDelegate>>());
 8323            services.TryAddTransient<IFramingConnectionHandshakeBuilder, FramingConnectionHandshakeBuilder>();
 8324            return services;
 25        }
 26    }
 27}