< Summary

Information
Class: NexusLabs.Needlr.DumpOptions
Assembly: NexusLabs.Needlr
File(s): /home/runner/work/needlr/needlr/src/NexusLabs.Needlr/DumpOptions.cs
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 32
Line coverage: 100%
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
get_LifetimeFilter()100%11100%
get_ServiceTypeFilter()100%11100%
get_GroupByLifetime()100%11100%
get_Default()100%11100%

File(s)

/home/runner/work/needlr/needlr/src/NexusLabs.Needlr/DumpOptions.cs

#LineLine coverage
 1using Microsoft.Extensions.DependencyInjection;
 2
 3namespace NexusLabs.Needlr;
 4
 5/// <summary>
 6/// Options for customizing the output of <see cref="DumpExtensions.Dump(IServiceCollection, DumpOptions?)"/>.
 7/// </summary>
 8public sealed record DumpOptions
 9{
 10    /// <summary>
 11    /// Gets or sets an optional filter to only include services with a specific lifetime.
 12    /// When null, all lifetimes are included.
 13    /// </summary>
 1014    public ServiceLifetime? LifetimeFilter { get; init; }
 15
 16    /// <summary>
 17    /// Gets or sets an optional predicate to filter services by their service type.
 18    /// When null, all service types are included.
 19    /// </summary>
 1020    public Func<Type, bool>? ServiceTypeFilter { get; init; }
 21
 22    /// <summary>
 23    /// Gets or sets whether to group registrations by lifetime in the output.
 24    /// Default is false.
 25    /// </summary>
 726    public bool GroupByLifetime { get; init; }
 27
 28    /// <summary>
 29    /// Gets the default dump options with no filtering.
 30    /// </summary>
 431    public static DumpOptions Default => new();
 32}