public IReadOnlyList <MethodGroup> DiscoverTestMethodGroups(Assembly assembly) { RunContext.Set(options); var conventions = new ConventionDiscoverer(assembly).GetConventions(); var discoveredTestMethodGroups = new List <MethodGroup>(); foreach (var convention in conventions) { var classDiscoverer = new ClassDiscoverer(convention); var candidateTypes = assembly.GetTypes(); var testClasses = classDiscoverer.TestClasses(candidateTypes); var methodDiscoverer = new MethodDiscoverer(convention); foreach (var testClass in testClasses) { var distinctMethodGroups = new Dictionary <string, MethodGroup>(); foreach (var testMethod in methodDiscoverer.TestMethods(testClass)) { var methodGroup = new MethodGroup(testMethod); distinctMethodGroups[methodGroup.FullName] = methodGroup; } discoveredTestMethodGroups.AddRange(distinctMethodGroups.Values); } } return(discoveredTestMethodGroups); }
public IReadOnlyList<MethodGroup> DiscoverTestMethodGroups(Assembly assembly) { RunContext.Set(options); var conventions = new ConventionDiscoverer(assembly).GetConventions(); var discoveredTestMethodGroups = new List<MethodGroup>(); foreach (var convention in conventions) { var classDiscoverer = new ClassDiscoverer(convention); var candidateTypes = assembly.GetTypes(); var testClasses = classDiscoverer.TestClasses(candidateTypes); var methodDiscoverer = new MethodDiscoverer(convention); foreach (var testClass in testClasses) { var distinctMethodGroups = new Dictionary<string, MethodGroup>(); foreach (var testMethod in methodDiscoverer.TestMethods(testClass)) { var methodGroup = new MethodGroup(testMethod); distinctMethodGroups[methodGroup.FullName] = methodGroup; } discoveredTestMethodGroups.AddRange(distinctMethodGroups.Values); } } return discoveredTestMethodGroups; }
public ClassRunner(Listener listener, Configuration config) { this.listener = listener; executionPlan = new ExecutionPlan(config); methodDiscoverer = new MethodDiscoverer(config); parameterDiscoverer = new ParameterDiscoverer(config); assertionLibraryFilter = new AssertionLibraryFilter(config); skipRules = config.SkipRules; orderCases = config.OrderCases; }
public ClassRunner(Bus bus, Discovery discovery, Execution execution) { var config = discovery.Config; this.bus = bus; this.execution = execution; methodDiscoverer = new MethodDiscoverer(discovery); parameterDiscoverer = new ParameterDiscoverer(discovery); orderMethods = config.OrderMethods; }
public ClassRunner(Listener listener, Configuration config) { this.listener = listener; executionPlan = new ExecutionPlan(config); methodDiscoverer = new MethodDiscoverer(config); parameterDiscoverer = new ParameterDiscoverer(config); assertionLibraryFilter = new AssertionLibraryFilter(config); skipRules = config.SkipRules; orderCases = config.OrderCases; }
public ClassRunner(Listener listener, Convention convention) { var config = convention.Config; this.listener = listener; executionPlan = new ExecutionPlan(convention); methodDiscoverer = new MethodDiscoverer(convention); parameterDiscoverer = new ParameterDiscoverer(convention); assertionLibraryFilter = new AssertionLibraryFilter(convention); skipBehaviors = config.SkipBehaviors; orderCases = config.OrderCases; }
public ClassRunner(Listener listener, Convention convention) { var config = convention.Config; this.listener = listener; executionPlan = new ExecutionPlan(convention); methodDiscoverer = new MethodDiscoverer(convention); parameterDiscoverer = new ParameterDiscoverer(convention); assertionLibraryFilter = new AssertionLibraryFilter(convention); skipBehaviors = config.SkipBehaviors; orderCases = config.OrderCases; }
public void DiscoverMethods(Assembly assembly) { var discovery = new BehaviorDiscoverer(assembly, customArguments).GetDiscovery(); try { var classDiscoverer = new ClassDiscoverer(discovery); var candidateTypes = assembly.GetTypes(); var testClasses = classDiscoverer.TestClasses(candidateTypes); var methodDiscoverer = new MethodDiscoverer(discovery); foreach (var testClass in testClasses) { foreach (var testMethod in methodDiscoverer.TestMethods(testClass)) { bus.Publish(new MethodDiscovered(testMethod)); } } } finally { discovery.Dispose(); } }