< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Channels.NetNamedPipeOptions
Assembly: CoreWCF.NetNamedPipe
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.NetNamedPipe/src/CoreWCF/Channels/NetNamedPipeOptions.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 14
Coverable lines: 14
Total lines: 36
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 4
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
Listen(...)100%110%
Listen(...)100%110%
Listen(...)100%110%
Listen(...)0%440%
ApplyEndpointDefaults(...)100%110%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.NetNamedPipe/src/CoreWCF/Channels/NetNamedPipeOptions.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.Runtime.Versioning;
 7
 8namespace CoreWCF.Channels
 9{
 10    [SupportedOSPlatform("windows")]
 11    public class NetNamedPipeOptions
 12    {
 013        internal List<NamedPipeListenOptions> CodeBackedListenOptions { get; } = new List<NamedPipeListenOptions>();
 014        public IServiceProvider ApplicationServices { get; internal set; }
 15
 016        public void Listen(string baseAddress) => Listen(new Uri(baseAddress));
 017        public void Listen(Uri baseAddress) => Listen(baseAddress, _ => { });
 18
 019        public void Listen(string baseAddress, Action<NamedPipeListenOptions> configure) => Listen(new Uri(baseAddress),
 20        public void Listen(Uri baseAddress, Action<NamedPipeListenOptions> configure)
 21        {
 022            if (baseAddress == null) throw new ArgumentNullException(nameof(baseAddress));
 023            if (configure == null) throw new ArgumentNullException(nameof(configure));
 24
 025            var listenOptions = new NamedPipeListenOptions(baseAddress);
 026            ApplyEndpointDefaults(listenOptions);
 027            configure(listenOptions);
 028            CodeBackedListenOptions.Add(listenOptions);
 029        }
 30
 31        private void ApplyEndpointDefaults(NamedPipeListenOptions listenOptions)
 32        {
 033            listenOptions.NetNamedPipeServerOptions = this;
 034        }
 35    }
 36}