< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Channels.UnixDomainSocketTransportBindingElement
Assembly: CoreWCF.UnixDomainSocket
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.UnixDomainSocket/src/CoreWCF/Channels/UnixDomainSocketTransportBindingElement.cs
Line coverage
59%
Covered lines: 13
Uncovered lines: 9
Coverable lines: 22
Total lines: 80
Line coverage: 59%
Branch coverage
33%
Covered branches: 2
Total branches: 6
Branch coverage: 33.3%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor()100%11100%
.ctor(...)100%11100%
Clone()100%11100%
GetProperty(...)50%4460%
BuildServiceDispatcher(...)100%11100%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.UnixDomainSocket/src/CoreWCF/Channels/UnixDomainSocketTransportBindingElement.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.Security.Authentication.ExtendedProtection;
 6using CoreWCF.Configuration;
 7
 8namespace CoreWCF.Channels
 9{
 10    public class UnixDomainSocketTransportBindingElement : ConnectionOrientedTransportBindingElement
 11    {
 12        private int _listenBacklog;
 13        private ExtendedProtectionPolicy _extendedProtectionPolicy;
 14
 715        public UnixDomainSocketTransportBindingElement() : base()
 16        {
 717            _listenBacklog = UnixDomainTransportDefaults.GetListenBacklog();
 718            _extendedProtectionPolicy = ChannelBindingUtility.DefaultPolicy;
 719        }
 5620        protected UnixDomainSocketTransportBindingElement(UnixDomainSocketTransportBindingElement elementToBeCloned) : b
 21        {
 5622            _listenBacklog = elementToBeCloned._listenBacklog;
 5623        }
 24
 25        public int ListenBacklog
 26        {
 27            get
 28            {
 029                return _listenBacklog;
 30            }
 31
 32            set
 33            {
 034                if (value <= 0)
 35                {
 036                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(val
 037                        SRCommon.ValueMustBePositive));
 38                }
 39
 040                _listenBacklog = value;
 041            }
 42        }
 43
 44        public override string Scheme
 45        {
 1746            get { return "net.uds"; }
 47        }
 48
 49        /// <summary>
 50        /// TODO : check the scheme
 51        /// </summary>
 052         protected override string WsdlTransportUri => "http://schemas.microsoft.com/soap/uds";
 53
 54        public override BindingElement Clone()
 55        {
 5656            return new UnixDomainSocketTransportBindingElement(this);
 57        }
 58
 59        public override T GetProperty<T>(BindingContext context)
 60        {
 861            if (context == null)
 62            {
 063                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(context));
 64            }
 865            else if (typeof(T) == typeof(ITransportCompressionSupport))
 66            {
 067                return (T)(object)new TransportCompressionSupportHelper();
 68            }
 69            else
 70            {
 871                return base.GetProperty<T>(context);
 72            }
 73        }
 74
 75        public override IServiceDispatcher BuildServiceDispatcher<TChannel>(BindingContext context, IServiceDispatcher i
 76        {
 377            return innerDispatcher;
 78        }
 79    }
 80}