internal ExecutionSummary Run(IReadOnlyList <Type> candidateTypes, Discovery discovery, Execution execution) { bus.Publish(new AssemblyStarted(assembly)); var assemblySummary = new ExecutionSummary(); var stopwatch = Stopwatch.StartNew(); var classDiscoverer = new ClassDiscoverer(discovery); var classRunner = new ClassRunner(bus, discovery, execution); var testClasses = classDiscoverer.TestClasses(candidateTypes); bool isOnlyTestClass = testClasses.Count == 1; foreach (var testClass in testClasses) { var classSummary = classRunner.Run(testClass, isOnlyTestClass); assemblySummary.Add(classSummary); } stopwatch.Stop(); bus.Publish(new AssemblyCompleted(assembly, assemblySummary, stopwatch.Elapsed)); return(assemblySummary); }
void Pass(Case @case, ExecutionSummary summary) { var message = new CasePassed(@case); summary.Add(message); bus.Publish(message); }
void Fail(Case @case, ExecutionSummary summary) { var message = new CaseFailed(@case); summary.Add(message); bus.Publish(message); }
void Skip(Case @case, ExecutionSummary summary) { var message = new CaseSkipped(@case); summary.Add(message); bus.Publish(message); }
void Run(Discovery discovery, Execution execution, Type[] candidateTypes, ExecutionSummary assemblySummary) { var classDiscoverer = new ClassDiscoverer(discovery); var classRunner = new ClassRunner(bus, discovery, execution); var testClasses = classDiscoverer.TestClasses(candidateTypes); bool isOnlyTestClass = testClasses.Count == 1; foreach (var testClass in testClasses) { var classSummary = classRunner.Run(testClass, isOnlyTestClass); assemblySummary.Add(classSummary); } }