< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Description.CollectionExtensions
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Description/CollectionExtensions.cs
Line coverage
66%
Covered lines: 2
Uncovered lines: 1
Coverable lines: 3
Total lines: 24
Line coverage: 66.6%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
FindAll(...)50%2266.66%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Description/CollectionExtensions.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.Collections.ObjectModel;
 6using CoreWCF.Collections.Generic;
 7using CoreWCF.Runtime;
 8
 9namespace CoreWCF.Description
 10{
 11    internal static class CollectionExtensions
 12    {
 13        public static Collection<T2> FindAll<T, T2>(this KeyedCollection<Type, T> keyedCollection)
 14        {
 22315            if (keyedCollection is KeyedByTypeCollection<T> keyedByTypeCollection)
 16            {
 22317                return keyedByTypeCollection.FindAll<T2>();
 18            }
 19
 20            Fx.Assert($"Collection must be of type KeyedByTypeCollection<{typeof(T).Name}>");
 021            throw new ArgumentException($"Collection must be of type KeyedByTypeCollection<{typeof(T).Name}>", nameof(ke
 22        }
 23    }
 24}