< Summary

Information
Class: NexusLabs.Needlr.Generators.Models.DiscoveredComposedRegistration
Assembly: NexusLabs.Needlr.Generators
File(s): /home/runner/work/needlr/needlr/src/NexusLabs.Needlr.Generators/Models/Composition/DiscoveredComposedRegistration.cs
Line coverage
92%
Covered lines: 12
Uncovered lines: 1
Coverable lines: 13
Total lines: 45
Line coverage: 92.3%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_FacadeTypeName()100%11100%
get_ClosedCompositionTypeName()100%11100%
get_ConstructorArguments()100%11100%
get_Lifetime()100%11100%
get_AssemblyName()100%210%
get_SourceFilePath()100%11100%

File(s)

/home/runner/work/needlr/needlr/src/NexusLabs.Needlr.Generators/Models/Composition/DiscoveredComposedRegistration.cs

#LineLine coverage
 1using System.Collections.Generic;
 2
 3namespace NexusLabs.Needlr.Generators.Models;
 4
 5/// <summary>
 6/// A fully resolved composed registration: one closed composition type, exposed as a facade service type,
 7/// with its constructor dependencies resolved to service-provider expressions. Emitted as a single
 8/// <c>services.Add{Lifetime}</c> registration.
 9/// </summary>
 10internal readonly struct DiscoveredComposedRegistration
 11{
 12    public DiscoveredComposedRegistration(
 13        string facadeTypeName,
 14        string closedCompositionTypeName,
 15        IReadOnlyList<string> constructorArguments,
 16        GeneratorLifetime lifetime,
 17        string assemblyName,
 18        string? sourceFilePath)
 19    {
 5420        FacadeTypeName = facadeTypeName;
 5421        ClosedCompositionTypeName = closedCompositionTypeName;
 5422        ConstructorArguments = constructorArguments;
 5423        Lifetime = lifetime;
 5424        AssemblyName = assemblyName;
 5425        SourceFilePath = sourceFilePath;
 5426    }
 27
 28    /// <summary>The fully qualified facade service type the closed composition is registered as.</summary>
 10829    public string FacadeTypeName { get; }
 30
 31    /// <summary>The fully qualified closed composition type to instantiate (e.g., global::N.FooCore&lt;global::N.AlphaD
 10832    public string ClosedCompositionTypeName { get; }
 33
 34    /// <summary>The constructor argument expressions (e.g., sp.GetRequiredService&lt;...&gt;()), in declaration order.<
 29135    public IReadOnlyList<string> ConstructorArguments { get; }
 36
 37    /// <summary>The lifetime this registration is given.</summary>
 5438    public GeneratorLifetime Lifetime { get; }
 39
 40    /// <summary>The name of the assembly that declared the composition type.</summary>
 041    public string AssemblyName { get; }
 42
 43    /// <summary>The source file path of the composition type, if available.</summary>
 10844    public string? SourceFilePath { get; }
 45}