Пример #1
0
        public bool SetTargetPosition(TestPosition position, out Exception existingError)
        {
            _targetPosition = position;

            existingError = _errorAccumulator.GetErrorForPosition(position);

            return(existingError != null || _targetPosition.Equals(_currentTestPosition));
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }