< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Channels.BindingParameterCollection
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Channels/BindingParameterCollection.cs
Line coverage
46%
Covered lines: 6
Uncovered lines: 7
Coverable lines: 13
Total lines: 42
Line coverage: 46.1%
Branch coverage
37%
Covered branches: 3
Total branches: 8
Branch coverage: 37.5%
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(...)0%440%
.ctor(...)75%4483.33%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Channels/BindingParameterCollection.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.Collections.Generic;
 5
 6namespace CoreWCF.Channels
 7{
 8    // Some binding elements can sometimes consume extra information when building factories.
 9    // BindingParameterCollection is a collection of objects with this extra information.
 10    // See comments in SecurityBindingElement and TransactionFlowBindingElement for examples
 11    // of binding elements that go looking for certain data in this collection.
 12    public class BindingParameterCollection : KeyedByTypeCollection<object>
 13    {
 1812214        public BindingParameterCollection() { }
 15
 016        internal BindingParameterCollection(params object[] parameters)
 17        {
 018            if (parameters == null)
 19            {
 020                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(parameters));
 21            }
 22
 023            for (int i = 0; i < parameters.Length; i++)
 24            {
 025                Add(parameters[i]);
 26            }
 027        }
 28
 2204629        internal BindingParameterCollection(BindingParameterCollection parameters)
 30        {
 2204631            if (parameters == null)
 32            {
 033                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(parameters));
 34            }
 35
 6111036            for (int i = 0; i < parameters.Count; i++)
 37            {
 850938                Add(parameters[i]);
 39            }
 2204640        }
 41    }
 42}