public bool SetTargetPosition(TestPosition position, out Exception existingError) { _targetPosition = position; existingError = _errorAccumulator.GetErrorForPosition(position); return(existingError != null || _targetPosition.Equals(_currentTestPosition)); }
public void visitTest(TestElement element, TestPosition position) { CheckNotAlreadyPastDiscovery(element); _currentTestPosition = position; while (position.Equals(_targetPosition)) { _runningLock.PassAndWaitForTurn(); } _setupResultAccumulator.UnwindForPosition(_targetPosition, e => { ReportError(TestPosition.At(0), e); }); _traceTracker.UnwindToPosition(_targetPosition); }
public void visitFork(ForkElement element, TestPosition position) { if (position.IsAncestorOf(_targetPosition)) { try { element.Action(); } catch (Exception e) { ReportError(position, e); } } while (position.Equals(_targetPosition)) { _currentTestPosition = position; _runningLock.PassAndWaitForTurn(); } _setupResultAccumulator.UnwindForPosition(_targetPosition, e => ReportError(TestPosition.At(0), e)); _traceTracker.UnwindToPosition(_targetPosition); }