public void VisualStudio_NoRuleTemplates() { var analyzers = GetDiagnosticAnalyzerTypes(new[] { RuleFinder.GetPackagedRuleAssembly() }); foreach (var analyzer in analyzers.Where(RuleFinder.IsRuleTemplate)) { Assert.Fail("Visual Studio rules cannot be templates, remove DiagnosticAnalyzer '{0}'.", analyzer.Name); } }
public void VisualStudio_OnlyParameterlessRules() { var analyzers = GetDiagnosticAnalyzerTypes(new[] { RuleFinder.GetPackagedRuleAssembly() }); foreach (var analyzer in analyzers) { var hasParameter = analyzer.GetProperties().Any(p => p.GetCustomAttributes <RuleParameterAttribute>().Any()); if (hasParameter) { Assert.Fail("Visual Studio rules cannot have parameters, remove DiagnosticAnalyzer '{0}'.", analyzer.Name); } } }
public void GetPackagedRuleAssembly() { Assert.IsNotNull(RuleFinder.GetPackagedRuleAssembly()); }