< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Configuration.TcpConnectionPoolSettingsElement
Assembly: CoreWCF.ConfigurationManager
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.ConfigurationManager/src/CoreWCF/Configuration/TcpConnectionPoolSettingsElement.cs
Line coverage
31%
Covered lines: 6
Uncovered lines: 13
Coverable lines: 19
Total lines: 62
Line coverage: 31.5%
Branch coverage
16%
Covered branches: 1
Total branches: 6
Branch coverage: 16.6%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
ApplyConfiguration(...)50%2280%
InitializeFrom(...)0%220%
CopyFrom(...)0%220%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.ConfigurationManager/src/CoreWCF/Configuration/TcpConnectionPoolSettingsElement.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.Configuration;
 6using CoreWCF.Channels;
 7
 8namespace CoreWCF.Configuration
 9{
 10    public sealed class TcpConnectionPoolSettingsElement : ServiceModelConfigurationElement
 11    {
 12        [ConfigurationProperty(ConfigurationStrings.IdleTimeout, DefaultValue = ConnectionOrientedTransportDefaults.Idle
 13        public TimeSpan IdleTimeout
 14        {
 215            get { return (TimeSpan)base[ConfigurationStrings.IdleTimeout]; }
 016            set { base[ConfigurationStrings.IdleTimeout] = value; }
 17        }
 18
 19        [ConfigurationProperty(ConfigurationStrings.MaxOutboundConnectionsPerEndpoint, DefaultValue = ConnectionOriented
 20        [IntegerValidator(MinValue = 0)]
 21        public int MaxOutboundConnectionsPerEndpoint
 22        {
 223            get { return (int)base[ConfigurationStrings.MaxOutboundConnectionsPerEndpoint]; }
 024            set { base[ConfigurationStrings.MaxOutboundConnectionsPerEndpoint] = value; }
 25        }
 26
 27        internal void ApplyConfiguration(TcpConnectionPoolSettings settings)
 28        {
 229            if (null == settings)
 30            {
 031                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(settings));
 32            }
 33
 234            settings.IdleTimeout = IdleTimeout;
 235            settings.MaxOutboundConnectionsPerEndpoint = MaxOutboundConnectionsPerEndpoint;
 236        }
 37
 38        internal void InitializeFrom(TcpConnectionPoolSettings settings)
 39        {
 040            if (null == settings)
 41            {
 042                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(settings));
 43            }
 44
 045            SetPropertyValueIfNotDefaultValue(ConfigurationStrings.IdleTimeout, settings.IdleTimeout);
 046            SetPropertyValueIfNotDefaultValue(ConfigurationStrings.MaxOutboundConnectionsPerEndpoint, settings.MaxOutbou
 047        }
 48
 49        internal void CopyFrom(TcpConnectionPoolSettingsElement source)
 50        {
 051            if (source == null)
 52            {
 053                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(source));
 54            }
 55
 56            //this.GroupName = source.GroupName;
 057            IdleTimeout = source.IdleTimeout;
 58            //this.LeaseTimeout = source.LeaseTimeout;
 059            MaxOutboundConnectionsPerEndpoint = source.MaxOutboundConnectionsPerEndpoint;
 060        }
 61    }
 62}