< Summary

Information
Class: NexusLabs.Needlr.Injection.Reflection.Loaders.AllAssembliesLoader
Assembly: NexusLabs.Needlr.Injection.Reflection
File(s): /home/runner/work/needlr/needlr/src/NexusLabs.Needlr.Injection.Reflection/Loaders/AllAssembliesLoader.cs
Line coverage
100%
Covered lines: 11
Uncovered lines: 0
Coverable lines: 11
Total lines: 27
Line coverage: 100%
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 Crap Score Cyclomatic complexity Line coverage
.ctor()50%22100%
LoadAssemblies(...)100%11100%

File(s)

/home/runner/work/needlr/needlr/src/NexusLabs.Needlr.Injection.Reflection/Loaders/AllAssembliesLoader.cs

#LineLine coverage
 1using System.Reflection;
 2
 3namespace NexusLabs.Needlr.Injection.Reflection.Loaders;
 4
 5/// <summary>
 6/// An assembly loader that loads all assemblies (.dll and .exe) from the application's base directory.
 7/// </summary>
 8public sealed class AllAssembliesLoader : IAssemblyLoader
 9{
 10    private readonly FileMatchAssemblyLoader _fileMatchAssemblyLoader;
 11
 412    public AllAssembliesLoader()
 13    {
 414        _fileMatchAssemblyLoader = new FileMatchAssemblyLoader(
 415            [AppDomain.CurrentDomain.BaseDirectory],
 416            fileName =>
 417            {
 16618                return
 16619                    fileName.EndsWith(".exe", StringComparison.OrdinalIgnoreCase) ||
 16620                    fileName.EndsWith(".dll", StringComparison.OrdinalIgnoreCase);
 421            });
 422    }
 23
 24    /// <inheritdoc />
 25    public IReadOnlyList<Assembly> LoadAssemblies(bool continueOnAssemblyError) =>
 326        _fileMatchAssemblyLoader.LoadAssemblies(continueOnAssemblyError);
 27}