< Summary

Information
Class: NexusLabs.Needlr.Injection.AssemblyOrdering.AssemblyOrderRule
Assembly: NexusLabs.Needlr.Injection
File(s): /home/runner/work/needlr/needlr/src/NexusLabs.Needlr.Injection/AssemblyOrdering/AssemblyOrderRule.cs
Line coverage
87%
Covered lines: 7
Uncovered lines: 1
Coverable lines: 8
Total lines: 31
Line coverage: 87.5%
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
get_Expression()100%210%
get_CompiledPredicate()100%11100%
get_Tier()100%11100%
.ctor(...)50%22100%

File(s)

/home/runner/work/needlr/needlr/src/NexusLabs.Needlr.Injection/AssemblyOrdering/AssemblyOrderRule.cs

#LineLine coverage
 1using System.Linq.Expressions;
 2
 3namespace NexusLabs.Needlr.Injection.AssemblyOrdering;
 4
 5/// <summary>
 6/// Represents a single ordering rule that matches assemblies to a tier.
 7/// </summary>
 8public sealed class AssemblyOrderRule
 9{
 10    /// <summary>
 11    /// The expression that determines if an assembly matches this rule.
 12    /// </summary>
 013    public Expression<Func<AssemblyInfo, bool>> Expression { get; }
 14
 15    /// <summary>
 16    /// The compiled predicate for runtime execution.
 17    /// </summary>
 21818    public Func<AssemblyInfo, bool> CompiledPredicate { get; }
 19
 20    /// <summary>
 21    /// The tier index (lower = earlier in sort order).
 22    /// </summary>
 11923    public int Tier { get; }
 24
 7125    internal AssemblyOrderRule(Expression<Func<AssemblyInfo, bool>> expression, int tier)
 26    {
 7127        Expression = expression ?? throw new ArgumentNullException(nameof(expression));
 7128        CompiledPredicate = expression.Compile();
 7129        Tier = tier;
 7130    }
 31}