< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Configuration.NetTcpBindingElement
Assembly: CoreWCF.ConfigurationManager
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.ConfigurationManager/src/CoreWCF/Configuration/NetTcpBindingElement.cs
Line coverage
72%
Covered lines: 29
Uncovered lines: 11
Coverable lines: 40
Total lines: 134
Line coverage: 72.5%
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
.ctor(...)100%11100%
.ctor()100%11100%
CreateBinding()100%11100%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.ConfigurationManager/src/CoreWCF/Configuration/NetTcpBindingElement.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 class NetTcpBindingElement : StandardBindingElement
 11    {
 12        public NetTcpBindingElement(string name)
 1013            : base(name)
 14        {
 1015        }
 16
 17        public NetTcpBindingElement()
 1018            : this(null)
 19        {
 1020        }
 21
 22        [ConfigurationProperty(ConfigurationStrings.TransactionFlow, DefaultValue = false)]
 23        public bool TransactionFlow
 24        {
 025            get { throw new PlatformNotSupportedException(); }
 26        }
 27
 28        [ConfigurationProperty(ConfigurationStrings.TransferMode, DefaultValue = TransferMode.Buffered)]
 29        public TransferMode TransferMode
 30        {
 931            get { return (TransferMode)base[ConfigurationStrings.TransferMode]; }
 032            set { base[ConfigurationStrings.TransferMode] = value; }
 33        }
 34
 35        [ConfigurationProperty(ConfigurationStrings.TransactionProtocol, DefaultValue = "")]
 36        public string TransactionProtocol
 37        {
 038            get { throw new PlatformNotSupportedException(); }
 39        }
 40
 41        [ConfigurationProperty(ConfigurationStrings.HostNameComparisonMode, DefaultValue = HostNameComparisonMode.Strong
 42        public HostNameComparisonMode HostNameComparisonMode
 43        {
 944            get { return (HostNameComparisonMode)base[ConfigurationStrings.HostNameComparisonMode]; }
 045            set { base[ConfigurationStrings.HostNameComparisonMode] = value; }
 46        }
 47
 48        [ConfigurationProperty(ConfigurationStrings.ListenBacklog, DefaultValue = 1)]
 49        [IntegerValidator(MinValue = 0)]
 50        public int ListenBacklog
 51        {
 052            get { throw new PlatformNotSupportedException(); }
 53        }
 54
 55        [ConfigurationProperty(ConfigurationStrings.MaxBufferPoolSize, DefaultValue = 1L)]
 56        [LongValidator(MinValue = 0)]
 57        public long MaxBufferPoolSize
 58        {
 959            get { return (long)base[ConfigurationStrings.MaxBufferPoolSize]; }
 060            set { base[ConfigurationStrings.MaxBufferPoolSize] = value; }
 61        }
 62
 63        [ConfigurationProperty(ConfigurationStrings.MaxBufferSize, DefaultValue = 65536)]
 64        [IntegerValidator(MinValue = 1)]
 65        public int MaxBufferSize
 66        {
 1067            get { return (int)base[ConfigurationStrings.MaxBufferSize]; }
 068            set { base[ConfigurationStrings.MaxBufferSize] = value; }
 69        }
 70
 71        [ConfigurationProperty(ConfigurationStrings.MaxConnections, DefaultValue = 1)]
 72        [IntegerValidator(MinValue = 0)]
 73        public int MaxConnections
 74        {
 975            get { return (int)base[ConfigurationStrings.MaxConnections]; }
 076            set { base[ConfigurationStrings.MaxConnections] = value; }
 77        }
 78
 79        [ConfigurationProperty(ConfigurationStrings.MaxReceivedMessageSize, DefaultValue = 65536L)]
 80        [LongValidator(MinValue = 1)]
 81        public long MaxReceivedMessageSize
 82        {
 1083            get { return (long)base[ConfigurationStrings.MaxReceivedMessageSize]; }
 084            set { base[ConfigurationStrings.MaxReceivedMessageSize] = value; }
 85        }
 86
 87        [ConfigurationProperty(ConfigurationStrings.PortSharingEnabled, DefaultValue = false)]
 88        public bool PortSharingEnabled
 89        {
 090            get { throw new PlatformNotSupportedException(); }
 91        }
 92
 93        [ConfigurationProperty(ConfigurationStrings.ReliableSession)]
 94        public string ReliableSession
 95        {
 096            get { throw new PlatformNotSupportedException(); }
 97        }
 98
 99        [ConfigurationProperty(ConfigurationStrings.Security)]
 100        public NetTcpSecurityElement Security
 101        {
 18102            get { return (NetTcpSecurityElement)base[ConfigurationStrings.Security]; }
 103        }
 104
 105        [ConfigurationProperty(ConfigurationStrings.ReaderQuotas)]
 106        public XmlDictionaryReaderQuotasElement ReaderQuotas
 107        {
 10108            get { return (XmlDictionaryReaderQuotasElement)base[ConfigurationStrings.ReaderQuotas]; }
 109        }
 110
 111        public override Binding CreateBinding()
 112        {
 9113            var binding = new NetTcpBinding(Security.Mode)
 9114            {
 9115                Name = Name,
 9116                MaxReceivedMessageSize = MaxReceivedMessageSize,
 9117                MaxBufferSize = MaxBufferSize,
 9118                MaxBufferPoolSize = MaxBufferPoolSize,
 9119                MaxConnections = MaxConnections,
 9120                ReceiveTimeout = ReceiveTimeout,
 9121                OpenTimeout = OpenTimeout,
 9122                CloseTimeout = CloseTimeout,
 9123                SendTimeout = SendTimeout,
 9124                ReaderQuotas = ReaderQuotas.Clone(),
 9125                TransferMode = TransferMode,
 9126                HostNameComparisonMode = HostNameComparisonMode
 9127            };
 128
 129            //this.ReliableSession.ApplyConfiguration(nptBinding.ReliableSession);
 9130            Security.ApplyConfiguration(binding.Security);
 9131            return binding;
 132        }
 133    }
 134}