diff --git a/TUnit.Core/Helpers/ArgumentFormatter.cs b/TUnit.Core/Helpers/ArgumentFormatter.cs index 15c11f3333..15e7c3cf60 100644 --- a/TUnit.Core/Helpers/ArgumentFormatter.cs +++ b/TUnit.Core/Helpers/ArgumentFormatter.cs @@ -90,27 +90,7 @@ private static string FormatDefault(object? o) if (o is string str) { // Replace dots with middle dot (·) to prevent VS Test Explorer from interpreting them as namespace separators - // Only do this if the string contains dots, to avoid unnecessary allocations - if (!str.Contains('.')) - { - return str; - } - -#if NET8_0_OR_GREATER - // Use Span for better performance - avoid string.Replace allocation - Span buffer = str.Length <= 256 - ? stackalloc char[str.Length] - : new char[str.Length]; - - for (int i = 0; i < str.Length; i++) - { - buffer[i] = str[i] == '.' ? '·' : str[i]; - } - - return new string(buffer); -#else return str.Replace(".", "·"); -#endif } if (toString == type.FullName || toString == type.AssemblyQualifiedName)