< Summary

Information
Class: Pozitron.QuerySpecification.WhereValidator
Assembly: Pozitron.QuerySpecification
File(s): /home/runner/work/QuerySpecification/QuerySpecification/src/QuerySpecification/Validators/WhereValidator.cs
Tag: 44_11195777782
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 17
Line coverage: 100%
Branch coverage
100%
Covered branches: 4
Total branches: 4
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%
.cctor()100%11100%
IsValid(...)100%44100%

File(s)

/home/runner/work/QuerySpecification/QuerySpecification/src/QuerySpecification/Validators/WhereValidator.cs

#LineLine coverage
 1namespace Pozitron.QuerySpecification;
 2
 3public class WhereValidator : IValidator
 4{
 25    private WhereValidator() { }
 16    public static WhereValidator Instance = new();
 7
 8    public bool IsValid<T>(T entity, Specification<T> specification)
 9    {
 4110        foreach (var whereExpression in specification.WhereExpressions)
 11        {
 1712            if (whereExpression.FilterFunc(entity) == false) return false;
 13        }
 14
 615        return true;
 516    }
 17}