public SpecificationEngine(ISystem system, ISpecRunner runner, IExecutionObserver observer) { _system = system; _runner = runner; _executionQueue = new ConsumingQueue(request => { if (request.IsCancelled) { return; } _warmup.Wait(30.Seconds()); observer.SpecStarted(request); var results = _runner.Execute(request, _executionQueue); if (!request.IsCancelled && results != null) { // TODO -- combine the two things here? request.SpecExecutionFinished(results); observer.SpecFinished(request); } }); _warmup = _system.Warmup().ContinueWith(t => { if (t.IsFaulted) { _runner.MarkAsInvalid(t.Exception); } }); }
public SpecificationEngine(ISystem system, ISpecRunner runner, IExecutionObserver observer) { _system = system; _runner = runner; _executionQueue = new ConsumingQueue(request => { if (request.IsCancelled) { return; } _warmup.Wait(30.Seconds()); observer.SpecStarted(request); var results = _runner.Execute(request, _executionQueue ); if (!request.IsCancelled && results != null) { // TODO -- combine the two things here? request.SpecExecutionFinished(results); observer.SpecFinished(request); } }); _warmup = _system.Warmup().ContinueWith(t => { if (t.IsFaulted) { _runner.MarkAsInvalid(t.Exception); } }); }
/// <summary> /// Initializes a new instance of the <see cref="MainWindowController"/> class. /// </summary> /// <param name="specRunner">The spec runner.</param> public MainWindowController(ISpecRunner specRunner) { this.SpecRunner = specRunner; this.ViewModel = new MainWindowViewModel(); this.SetCommands(); this.WireUpEvents(); }
public SpecificationEngine(ISystem system, ISpecRunner runner, IExecutionObserver observer) { if (system == null) { throw new ArgumentNullException(nameof(system)); } if (runner == null) { throw new ArgumentNullException(nameof(runner)); } if (observer == null) { throw new ArgumentNullException(nameof(observer)); } _system = system; _runner = runner; _executionQueue = new ConsumingQueue(request => { if (request.IsCancelled) { return; } _warmup.Wait(30.Seconds()); var results = _runner.Execute(request, _executionQueue); if (!request.IsCancelled && (results != null)) { // TODO -- combine the two things here? request.SpecExecutionFinished(results); observer.SpecFinished(request); } }); var warmup = _system.Warmup(); if (warmup == null) { throw new InvalidOperationException($"{system} cannot return a null value from {nameof(ISystem.Warmup)}()"); } if (warmup.Status == TaskStatus.WaitingForActivation) { warmup.Start(); } _warmup = warmup.ContinueWith(t => { if (t.IsFaulted) { _runner.MarkAsInvalid(t.Exception); } }); }
public EngineController(ISpecificationEngine engine, IUserInterfaceObserver observer, ISpecRunner runner) { _engine = engine; _observer = observer; _runner = runner; }