public IEnumerable GetServiceMessagesFromFilesWithTestReports()

in TeamCity.CSharpInteractive/DotNetTestReportingService.cs [44:60]


    public IEnumerable<IServiceMessage> GetServiceMessagesFromFilesWithTestReports()
    {
        var teamCityTestReportFilesPath = _settings.TeamCityTestReportFilesPathEnvValue;
        if (teamCityTestReportFilesPath == null || !_fileSystem.IsDirectoryExist(teamCityTestReportFilesPath))
        {
            yield break;
        }

        foreach (var fileWithTestReports in _fileSystem.EnumerateFiles(teamCityTestReportFilesPath, "*.msg", SearchOption.TopDirectoryOnly))
        {
            using var textReader = _fileSystem.OpenTextReader(fileWithTestReports, Encoding.UTF8);
            foreach (var serviceMessage in _serviceMessageParser.ParseServiceMessages(textReader))
            {
                yield return serviceMessage;
            }
        }
    }