< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Configuration.NetHttpBindingElement
Assembly: CoreWCF.ConfigurationManager
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.ConfigurationManager/src/CoreWCF/Configuration/NetHttpBindingElement.cs
Line coverage
85%
Covered lines: 23
Uncovered lines: 4
Coverable lines: 27
Total lines: 75
Line coverage: 85.1%
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/NetHttpBindingElement.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 NetHttpBindingElement : HttpBindingBaseElement
 11    {
 12        public NetHttpBindingElement(string name)
 313            : base(name)
 14        {
 315        }
 16
 17        public NetHttpBindingElement()
 318            : this(null)
 19        {
 320        }
 21
 22        [ConfigurationProperty(ConfigurationStrings.MessageEncoding, DefaultValue = NetHttpMessageEncoding.Binary)]
 23        public NetHttpMessageEncoding MessageEncoding
 24        {
 425            get { return (NetHttpMessageEncoding)base[ConfigurationStrings.MessageEncoding]; }
 026            set { base[ConfigurationStrings.MessageEncoding] = value; }
 27        }
 28
 29
 30        [ConfigurationProperty(ConfigurationStrings.ReliableSession)]
 31        public string ReliableSession
 32        {
 033            get { throw new PlatformNotSupportedException(); }
 34        }
 35
 36
 37        [ConfigurationProperty(ConfigurationStrings.Security)]
 38        public BasicHttpSecurityElement Security
 39        {
 540            get { return (BasicHttpSecurityElement)base[ConfigurationStrings.Security]; }
 41        }
 42
 43        // todo how to implement ? WebSocketSettings is internal
 44        [ConfigurationProperty(ConfigurationStrings.WebSocketSettingsSectionName)]
 45        public NetHttpWebSocketTransportSettingsElement WebSocketSettings
 46        {
 047            get { return (NetHttpWebSocketTransportSettingsElement)base[ConfigurationStrings.WebSocketSettingsSectionNam
 048            set { base[ConfigurationStrings.WebSocketSettingsSectionName] = value; }
 49        }
 50
 51        public override Binding CreateBinding()
 52        {
 253            var binding = new NetHttpBinding(Security.Mode)
 254            {
 255                Name = Name,
 256                MaxReceivedMessageSize = MaxReceivedMessageSize,
 257                MaxBufferSize = MaxBufferSize,
 258                ReceiveTimeout = ReceiveTimeout,
 259                CloseTimeout = CloseTimeout,
 260                OpenTimeout = OpenTimeout,
 261                SendTimeout = SendTimeout,
 262                TransferMode = TransferMode,
 263                TextEncoding = TextEncoding,
 264                MessageEncoding = MessageEncoding,
 265                ReaderQuotas = ReaderQuotas.Clone(),
 266            };
 67
 268            binding.MessageEncoding = MessageEncoding;
 69            //WebSocketSettings.ApplyConfiguration(netHttpBinding.WebSocketSettings);
 70            // this.ReliableSession.ApplyConfiguration(netHttpBinding.ReliableSession);
 271            Security.ApplyConfiguration(binding.Security);
 272            return binding;
 73        }
 74    }
 75}