diff --git a/src/extension/ServiceMessageFactory.cs b/src/extension/ServiceMessageFactory.cs index 8e3bc56..89f69d2 100644 --- a/src/extension/ServiceMessageFactory.cs +++ b/src/extension/ServiceMessageFactory.cs @@ -16,29 +16,7 @@ internal class ServiceMessageFactory : IServiceMessageFactory private const string TcParseServiceMessagesInside = "tc:parseServiceMessagesInside"; private static readonly IEnumerable EmptyServiceMessages = new ServiceMessage[0]; private static readonly Regex AttachmentDescriptionRegex = new Regex("(.*)=>(.+)", RegexOptions.Compiled); - private static readonly List _invalidChars; - - static ServiceMessageFactory() - { - var invalidPathChars = Path.GetInvalidPathChars(); - var invalidFileNameChars = Path.GetInvalidFileNameChars(); - _invalidChars = new List(invalidPathChars.Length + invalidFileNameChars.Length); - foreach (var c in invalidPathChars) - { - _invalidChars.Add(c); - } - - foreach (var c in invalidFileNameChars) - { - if (_invalidChars.Contains(c)) - { - continue; - } - - _invalidChars.Add(c); - } - } - + public ServiceMessageFactory(ITeamCityInfo teamCityInfo, ISuiteNameReplacer suiteNameReplacer) { _teamCityInfo = teamCityInfo; @@ -382,18 +360,7 @@ private static IEnumerable Attachments(EventId eventId, XmlNode if (artifactDir == null) { - var testDirNameChars = new char[eventId.FullName.Length]; - eventId.FullName.CopyTo(0, testDirNameChars, 0, eventId.FullName.Length); - for (var i = 0; i < testDirNameChars.Length; i++) - { - if (_invalidChars.Contains(testDirNameChars[i])) - { - testDirNameChars[i] = '_'; - } - } - - var testDirName = new string(testDirNameChars); - artifactDir = ".teamcity/NUnit/" + testDirName + "/" + Guid.NewGuid(); + artifactDir = ".teamcity/NUnit/" + Guid.NewGuid(); } string artifactType;