< Summary

Information
Class: Pozitron.QuerySpecification.ParameterReplacerVisitor
Assembly: Pozitron.QuerySpecification.EntityFrameworkCore
File(s): /home/runner/work/QuerySpecification/QuerySpecification/src/QuerySpecification.EntityFrameworkCore/Extensions/ParameterReplacerVisitor.cs
Tag: 44_11195777782
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 19
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
Replace(...)100%11100%
VisitParameter(...)100%22100%

File(s)

/home/runner/work/QuerySpecification/QuerySpecification/src/QuerySpecification.EntityFrameworkCore/Extensions/ParameterReplacerVisitor.cs

#LineLine coverage
 1namespace Pozitron.QuerySpecification;
 2
 3internal class ParameterReplacerVisitor : ExpressionVisitor
 4{
 5    private readonly ParameterExpression _oldParameter;
 6    private readonly Expression _newExpression;
 7
 318    private ParameterReplacerVisitor(ParameterExpression oldParameter, Expression newExpression)
 9    {
 3110        _oldParameter = oldParameter;
 3111        _newExpression = newExpression;
 3112    }
 13
 14    internal static Expression Replace(Expression expression, ParameterExpression oldParameter, Expression newExpression
 3115      => new ParameterReplacerVisitor(oldParameter, newExpression).Visit(expression);
 16
 17    protected override Expression VisitParameter(ParameterExpression node)
 6318      => node == _oldParameter ? _newExpression : node;
 19}