private string category(SprinklerTestClass instance) { var moduleAttr = instance.GetType() .GetCustomAttributes(typeof(SprinklerTestModuleAttribute), false).FirstOrDefault() as SprinklerTestModuleAttribute; return(moduleAttr != null ? moduleAttr.Name : "General"); }
public static IEnumerable <SprinklerTestClass> InstanciateAll() { Assembly assembly = Assembly.GetExecutingAssembly(); IEnumerable <Type> testclasses = GetTypesWithAttribute <SprinklerTestModuleAttribute>(assembly); foreach (Type t in testclasses) { SprinklerTestClass c = (SprinklerTestClass)Activator.CreateInstance(t); yield return(c); } }
public void Run(SprinklerTestClass Instance, IEnumerable <string> codes = null) { Instance.SetClient(client); string category = this.category(Instance); foreach (var method in TestMethodsOf(Instance, codes)) { TestResult test = RunTestMethod(category, Instance, method); this.log(test); } }