API Reference
RuleRegistry
Automatic rule discovery system - no manual registration needed! Just create a static class with GetRule() method and it gets discovered automatically.
Inheritance
- Object
- RuleRegistry
Methods
public static Rule CreateRule(CSharpRule csharpRule) #RuleCreates a rule instance from typed C# rule enum
Parameters
- csharpRule TestimoX.Definitions.CSharpRule
public static Rule CreateRule(String ruleName) #RuleCreates a rule instance by name - automatically discovered rules
Parameters
- ruleName System.String
public static IEnumerable<Rule> CreateRules(IEnumerable<String> ruleNames) #IEnumerable<Rule>Creates rule instances from typed C# rule enum (backward compatibility)
Parameters
- csharpRules System.Collections.Generic.IEnumerable{TestimoX.Definitions.CSharpRule}
CreateRules(System.Collections.Generic.IEnumerable{System.String} ruleNames) #Creates rule instances from string names
Parameters
- ruleNames System.Collections.Generic.IEnumerable{System.String}
public static Void DiscoverExternalRules(Assembly assembly) #VoidDiscovers rules from external assemblies (like ADPlayground)
Parameters
- assembly System.Reflection.Assembly
DiscoverRules(System.Reflection.Assembly arg1) #Discovers rules from any assembly - completely automatic!
Parameters
- arg1 System.Reflection.Assembly
DiscoverRulesFromCurrentAssembly() #Automatically discovers all rules from the current TestimoX assembly
public static IEnumerable<Rule> GetAllDiscoveredCSharpRules() #IEnumerable<Rule>Gets all automatically discovered C# rules
public static IEnumerable<String> GetAvailableCSharpRuleNames() #IEnumerable<String>Gets all automatically discovered C# rule names
public static IEnumerable<String> GetCSharpMethodRuleNames() #IEnumerable<String>Gets all C# method rule names (fastest rules)
public static IEnumerable<String> GetCSharpPowerShellRuleNames() #IEnumerable<String>Gets all C# PowerShell rule names (legacy rules)
public static String GetDiscoveredRulesDebugInfo() #StringGets debug info about discovered rules including PowerShell script rules.
public static Task<String> GetDiscoveredRulesDebugInfoAsync() #Task<String>Asynchronously gets debug info about discovered rules including PowerShell script rules.
GetRuleName(System.Type arg1) #Gets the rule name from a type, preferring the actual rule name over class name
Parameters
- arg1 System.Type
TryMapToEnum(System.String arg1, System.String arg2) #Tries to map discovered rules to the CSharpRule enum for backward compatibility
Parameters
- arg1 System.String
- arg2 System.String