示例#1
0
        private string category(SprinklerTestClass instance)
        {
            var moduleAttr = instance.GetType()
                             .GetCustomAttributes(typeof(SprinklerTestModuleAttribute), false).FirstOrDefault()
                             as SprinklerTestModuleAttribute;

            return(moduleAttr != null ? moduleAttr.Name : "General");
        }
示例#2
0
        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);
            }
        }
示例#3
0
        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);
            }
        }