public static IsValidMethod ( |
||
method | ||
Результат | bool |
public virtual Repository Load() { var repository = new Repository(); foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) { if (IsDesiredAssembly(assembly)) { foreach (var type in assembly.GetTypes()) { foreach (var method in type.GetMethods(StepDefinition.MethodFlags)) { if (StepDefinition.IsValidMethod(method)) { repository.StepDefinitions.Add(new StepDefinition(method)); _objectFactory.AddClass(method.ReflectedType); } if (BeforeHook.IsValidMethod(method)) { repository.BeforeHooks.Add(new BeforeHook(method)); _objectFactory.AddClass(method.ReflectedType); } if (AfterHook.IsValidMethod(method)) { repository.AfterHooks.Add(new AfterHook(method)); _objectFactory.AddClass(method.ReflectedType); } } } } } return(repository); }
public virtual Repository Load() { var repository = new Repository(); foreach (var assemblyPath in _assemblyPaths) { var assembly = Assembly.LoadFrom(assemblyPath); foreach (var type in assembly.GetTypes()) { foreach (var method in type.GetMethods(StepDefinition.MethodFlags)) { if (StepDefinition.IsValidMethod(method)) { repository.StepDefinitions.Add(new StepDefinition(method)); _objectFactory.AddClass(method.ReflectedType); } if (BeforeHook.IsValidMethod(method)) { repository.BeforeHooks.Add(new BeforeHook(method)); _objectFactory.AddClass(method.ReflectedType); } if (AfterHook.IsValidMethod(method)) { repository.AfterHooks.Add(new AfterHook(method)); _objectFactory.AddClass(method.ReflectedType); } } } } return(repository); }
public BeforeHook(MethodInfo method) : base(method) { if (!BeforeHook.IsValidMethod(method)) { throw new ArgumentException(String.Format("<{0}> is not a valid Before hook method.", method)); } Method = method; }