< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Configuration.ServiceReflector
Assembly: CoreWCF.ConfigurationManager
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.ConfigurationManager/src/CoreWCF/Configuration/ServiceReflector.cs
Line coverage
75%
Covered lines: 3
Uncovered lines: 1
Coverable lines: 4
Total lines: 26
Line coverage: 75%
Branch coverage
75%
Covered branches: 3
Total branches: 4
Branch coverage: 75%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
ResolveTypeFromName(...)75%4475%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.ConfigurationManager/src/CoreWCF/Configuration/ServiceReflector.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.Reflection;
 6
 7namespace CoreWCF.Configuration
 8{
 9    internal class ServiceReflector
 10    {
 11        internal static Type ResolveTypeFromName(string name)
 12        {
 13            //First check if present in loaded assemblies
 22014            foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
 15            {
 8816                if (assembly.GetType(name) is Type found)
 17                {
 4418                    return found;
 19                }
 20            }
 21
 22            //If not present in loaded assemblies, AssemblyQualifiedName  should be "FooNameSpace.BarInterface,FooNameSp
 023            return Type.GetType(name, true);
 24        }
 25    }
 26}