Beispiel #1
0
        /// <summary>
        /// Initializes the Test Logger.
        /// </summary>
        /// <param name="events">Events that can be registered for.</param>
        /// <param name="testRunDirectory">Test Run Directory</param>
        public void Initialize(TestLoggerEvents events, string testRunDirectory)
        {
            // Register for the events.
            events.TestRunMessage  += TestMessageHandler;
            events.TestResult      += TestResultHandler;
            events.TestRunComplete += TestRunCompleteHandler;

            _teamCityWriter = new TeamCityServiceMessages().CreateWriter(w => Trace.WriteLine(w));
            _vsTestSuite    = _teamCityWriter.OpenTestSuite("VSTest");
        }
        /// <summary>
        /// Initializes the Test Logger.
        /// </summary>
        /// <param name="events">Events that can be registered for.</param>
        /// <param name="testRunDirectory">Test Run Directory</param>
        public void Initialize(TestLoggerEvents events, string testRunDirectory)
        {
            // Register for the events.
            events.TestRunMessage += TestMessageHandler;
            events.TestResult += TestResultHandler;
            events.TestRunComplete += TestRunCompleteHandler;

            _teamCityWriter = new TeamCityServiceMessages().CreateWriter(w => Trace.WriteLine(w));
            _vsTestSuite = _teamCityWriter.OpenTestSuite("VSTest");
        }
        private ITeamCityTestsSubWriter GetTestSuiteWriter([NotNull] string source)
        {
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }
            if (_testSuiteWriter != null && _testSuiteSource == source)
            {
                return(_testSuiteWriter);
            }

            _testSuiteWriter?.Dispose();
            _testSuiteSource = source;
            var testSuiteWriter = _rootWriter.OpenTestSuite(source);

            _testSuiteWriter = testSuiteWriter;
            return(testSuiteWriter);
        }
Beispiel #4
0
 public TeamCityMessageSinkActor(Action <string> writer, string suiteName,
                                 bool useTestCoordinator) : base(useTestCoordinator)
 {
     _teamCityWriter          = new TeamCityServiceMessages().CreateWriter(writer);
     _teamCityTestSuiteWriter = _teamCityWriter.OpenTestSuite(suiteName);
 }