public IEnumerable <IRuleViolation> Evaluate(IProject target) { if (_filter.IsMatch(target.Name)) { return(_rule.Evaluate(target)); } return(Enumerable.Empty <IRuleViolation>()); }
static IEnumerable <IRuleViolation> SetupSomeViolations() { var solutionRuleViolation = new RuleViolation(SolutionRule, Solution, Some.String()); A.CallTo(() => SolutionRule.Evaluate(A <ISolution> ._)).Returns(new[] { solutionRuleViolation }); var projectRuleViolation = new RuleViolation(ProjectRule, Project, Some.String()); A.CallTo(() => ProjectRule.Evaluate(A <IProject> ._)).Returns(new[] { projectRuleViolation }); var projectItemRuleViolation = new RuleViolation(ProjectItemRule, ProjectItem, Some.String()); A.CallTo(() => ProjectItemRule.Evaluate(A <IProjectItem> ._)).Returns(new[] { projectItemRuleViolation }); return(new[] { solutionRuleViolation, projectRuleViolation, projectItemRuleViolation }); }