private static string GetShortTestName(string testName, int maxLength = 128)
        {
            var testNameLocal = GetLocalTestName(testName);
            var resultLength  = Math.Min(maxLength, testNameLocal.Length);
            var result        = new StringBuilder(resultLength);

            foreach (var symbol in testNameLocal.Take(resultLength))
            {
                var value = !IsUrlSafeChar(symbol) || InvalidPathChars.Contains(symbol) ? '_' : symbol;
                result.Append(value);
            }

            return(result.ToString());
        }
Example #2
0
 public static char[] GetInvalidPathChars() => (char[])InvalidPathChars.Clone();
Example #3
0
 public static bool IsValidPath(string path)
 {
     return(!string.IsNullOrWhiteSpace(path) && path.All(c => !InvalidPathChars.Contains(c)));
 }
Example #4
0
 public static char[] GetInvalidPathChars()
 {
     return((char[])InvalidPathChars.Clone());
 }