< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Channels.BindingElement
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Channels/BindingElement.cs
Line coverage
66%
Covered lines: 8
Uncovered lines: 4
Coverable lines: 12
Total lines: 58
Line coverage: 66.6%
Branch coverage
50%
Covered branches: 3
Total branches: 6
Branch coverage: 50%
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%
GetIndividualProperty()100%11100%
IsMatch(...)100%110%
BuildServiceDispatcher(...)50%4460%
CanBuildServiceDispatcher(...)50%2266.66%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Channels/BindingElement.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 CoreWCF.Configuration;
 5using CoreWCF.Runtime;
 6
 7namespace CoreWCF.Channels
 8{
 9    public abstract class BindingElement
 10    {
 2945411        protected BindingElement() { }
 12#pragma warning disable RECS0154 // Parameter is never used
 2491413        protected BindingElement(BindingElement elementToBeCloned) { }
 14#pragma warning restore RECS0154 // Parameter is never used
 15
 16        public abstract BindingElement Clone();
 17
 18        public abstract T GetProperty<T>(BindingContext context) where T : class;
 19
 20        internal T GetIndividualProperty<T>() where T : class
 21        {
 167622            return GetProperty<T>(new BindingContext(new CustomBinding(), new BindingParameterCollection()));
 23        }
 24
 25
 26        //TODO: Move back to internal
 27        protected virtual bool IsMatch(BindingElement b)
 28        {
 29            Fx.Assert(true, "Should not be called unless this binding element is used in one of the standard bindings. I
 030            return false;
 31        }
 32
 33        public virtual IServiceDispatcher BuildServiceDispatcher<TChannel>(BindingContext context, IServiceDispatcher in
 34        {
 48835            if (context == null)
 36            {
 037                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(context));
 38            }
 39
 48840            if (innerDispatcher == null)
 41            {
 042                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(innerDispatcher));
 43            }
 44
 48845            return context.BuildNextServiceDispatcher<TChannel>(innerDispatcher);
 46        }
 47
 48        public virtual bool CanBuildServiceDispatcher<TChannel>(BindingContext context) where TChannel : class, IChannel
 49        {
 192050            if (context == null)
 51            {
 052                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(context));
 53            }
 54
 192055            return context.CanBuildNextServiceDispatcher<TChannel>();
 56        }
 57    }
 58}