public void WriteLine(string message)
 {
     _testThreadExecutionEventPublisher.PublishEvent(new OutputAddedEvent(message));
     _traceListener.WriteToolOutput(message);
 }
Esempio n. 2
0
        public virtual void OnTestRunStart()
        {
            if (_testRunnerStartExecuted)
            {
                return;
            }

            if (_analyticsTransmitter.IsEnabled)
            {
                try
                {
                    var testAssemblyName    = _testRunnerManager.TestAssembly.GetName().Name;
                    var projectRunningEvent = _analyticsEventProvider.CreateProjectRunningEvent(testAssemblyName);
                    _analyticsTransmitter.TransmitSpecFlowProjectRunningEvent(projectRunningEvent);
                }
                catch (Exception)
                {
                    // catch all exceptions since we do not want to break anything
                }
            }

            _testRunnerStartExecuted = true;
            _cucumberMessageSender.SendTestRunStarted();
            _testRunResultCollector.StartCollecting();

            _testThreadExecutionEventPublisher.PublishEvent(new TestRunStartedEvent());

            FireEvents(HookType.BeforeTestRun);
        }