< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Configuration.StandardBindingElement
Assembly: CoreWCF.ConfigurationManager
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.ConfigurationManager/src/CoreWCF/Configuration/StandardBindingElement.cs
Line coverage
42%
Covered lines: 8
Uncovered lines: 11
Coverable lines: 19
Total lines: 71
Line coverage: 42.1%
Branch coverage
25%
Covered branches: 1
Total branches: 4
Branch coverage: 25%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor()100%110%
.ctor(...)50%2275%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.ConfigurationManager/src/CoreWCF/Configuration/StandardBindingElement.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 abstract class StandardBindingElement : ServiceModelConfigurationElement, IDefaultCommunicationTimeouts, ISta
 11    {
 12        protected StandardBindingElement()
 013            : this(null)
 14        {
 015        }
 16
 2417        protected StandardBindingElement(string name)
 18        {
 2419            if (!string.IsNullOrEmpty(name))
 20            {
 021                Name = name;
 22            }
 2423        }
 24
 25        [ConfigurationProperty(ConfigurationStrings.Name, Options = ConfigurationPropertyOptions.IsKey)]
 26        [StringValidator(MinLength = 0)]
 27        public string Name
 28        {
 9729            get { return (string)base[ConfigurationStrings.Name]; }
 30            set
 31            {
 032                if (string.IsNullOrEmpty(value))
 33                {
 034                    value = string.Empty;
 35                }
 036                base[ConfigurationStrings.Name] = value;
 037            }
 38        }
 39
 40        [ConfigurationProperty(ConfigurationStrings.CloseTimeout, DefaultValue = ServiceDefaults.CloseTimeoutString)]
 41        public TimeSpan CloseTimeout
 42        {
 1943            get { return (TimeSpan)base[ConfigurationStrings.CloseTimeout]; }
 044            set { base[ConfigurationStrings.CloseTimeout] = value; }
 45        }
 46
 47        [ConfigurationProperty(ConfigurationStrings.OpenTimeout, DefaultValue = ServiceDefaults.OpenTimeoutString)]
 48        public TimeSpan OpenTimeout
 49        {
 1950            get { return (TimeSpan)base[ConfigurationStrings.OpenTimeout]; }
 051            set { base[ConfigurationStrings.OpenTimeout] = value; }
 52        }
 53
 54        [ConfigurationProperty(ConfigurationStrings.ReceiveTimeout, DefaultValue = ServiceDefaults.ReceiveTimeoutString)
 55        public TimeSpan ReceiveTimeout
 56        {
 2457            get { return (TimeSpan)base[ConfigurationStrings.ReceiveTimeout]; }
 058            set { base[ConfigurationStrings.ReceiveTimeout] = value; }
 59        }
 60
 61        [ConfigurationProperty(ConfigurationStrings.SendTimeout, DefaultValue = ServiceDefaults.SendTimeoutString)]
 62        public TimeSpan SendTimeout
 63        {
 1964            get { return (TimeSpan)base[ConfigurationStrings.SendTimeout]; }
 065            set { base[ConfigurationStrings.SendTimeout] = value; }
 66        }
 67
 68        public abstract Binding CreateBinding();
 69
 70    }
 71}