public void SetUp() { dispatcher = new TestRunnerEventDispatcher(); log = new Log(); var ext = new TeamCityExtension("flow"); ext.Install(dispatcher, log); }
/// <summary> /// Creates a test runner. /// </summary> /// <param name="testIsolationProvider">The test isolation provider.</param> /// <param name="testFrameworkManager">The test framework manager.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="testIsolationProvider"/> /// or <paramref name="testFrameworkManager"/> is null.</exception> public DefaultTestRunner(ITestIsolationProvider testIsolationProvider, ITestFrameworkManager testFrameworkManager) { if (testIsolationProvider == null) throw new ArgumentNullException("testIsolationProvider"); if (testFrameworkManager == null) throw new ArgumentNullException("testFrameworkManager"); this.testIsolationProvider = testIsolationProvider; this.testFrameworkManager = testFrameworkManager; eventDispatcher = new TestRunnerEventDispatcher(); state = State.Created; extensions = new List<ITestRunnerExtension>(); }
public Listener(TestRunnerEventDispatcher eventDispatcher, TappedLogger tappedLogger, LockBox<Report> reportBox) { this.eventDispatcher = eventDispatcher; this.tappedLogger = tappedLogger; this.reportBox = reportBox; states = new Dictionary<string, TestStepState>(); rootTestStepIds = new List<string>(); rootTestStepStopwatch = Stopwatch.StartNew(); rootTestStepResult = new TestResult() { Outcome = TestOutcome.Passed }; consumer = new MessageConsumer() .Handle<TestDiscoveredMessage>(HandleTestDiscoveredMessage) .Handle<AnnotationDiscoveredMessage>(HandleAnnotationDiscoveredMessage) .Handle<TestStepStartedMessage>(HandleTestStepStartedMessage) .Handle<TestStepLifecyclePhaseChangedMessage>(HandleTestStepLifecyclePhaseChangedMessage) .Handle<TestStepMetadataAddedMessage>(HandleTestStepMetadataAddedMessage) .Handle<TestStepFinishedMessage>(HandleTestStepFinishedMessage) .Handle<TestStepLogAttachMessage>(HandleTestStepLogAttachMessage) .Handle<TestStepLogStreamWriteMessage>(HandleTestStepLogStreamWriteMessage) .Handle<TestStepLogStreamEmbedMessage>(HandleTestStepLogStreamEmbedMessage) .Handle<TestStepLogStreamBeginSectionBlockMessage>(HandleTestStepLogStreamBeginSectionBlockMessage) .Handle<TestStepLogStreamBeginMarkerBlockMessage>(HandleTestStepLogStreamBeginMarkerBlockMessage) .Handle<TestStepLogStreamEndBlockMessage>(HandleTestStepLogStreamEndBlockMessage) .Handle<LogEntrySubmittedMessage>(HandleLogEntrySubmittedMessage); tappedLogger.SetListener(this); }