private SpecificationEngine buildBatchedEngine(string tracingStyle) { IBatchObserver batchObserver = new BatchObserver(); IExecutionObserver executionObserver = new NulloObserver(); if ("TeamCity" == tracingStyle) { batchObserver = new TeamCityBatchObserver(batchObserver); executionObserver = new TeamCityExecutionObserver(); } var executionMode = new BatchExecutionMode(batchObserver); var runner = new SpecRunner(executionMode, _system, _specExpiration); var engine = new SpecificationEngine( _system, runner, executionObserver); _controller = new BatchController(engine, batchObserver); _services.Add(engine); EventAggregator.Messaging.AddListener(_controller); return(engine); }
private static SpecRunner buildRunner(RunInput input, List <Specification> specs, RunningSystem running, out IExecutionObserver executionObserver) { IBatchObserver batchObserver = new NulloBatchObservor(); executionObserver = new NulloObserver(); switch (input.TracingFlag) { case TracingStyle.verbose: batchObserver = new ConsoleBatchObserver(specs.Count); // TODO -- awesome if you could get smarter w/ the console output here break; case TracingStyle.teamcity: batchObserver = new TeamCityBatchObserver(); executionObserver = new TeamCityExecutionObserver(); break; case TracingStyle.appveyor: batchObserver = new AppVeyorBatchObserver(); break; } var runner = new SpecRunner(new BatchExecutionMode(batchObserver), running.System, executionObserver); runner.UseStopConditions(Project.CurrentProject.StopConditions); return(runner); }