diff --git a/tests/ImageSharp.Tests/TestUtilities/ImagingTestCaseUtility.cs b/tests/ImageSharp.Tests/TestUtilities/ImagingTestCaseUtility.cs
index 5867eaf85..7fd7a59a9 100644
--- a/tests/ImageSharp.Tests/TestUtilities/ImagingTestCaseUtility.cs
+++ b/tests/ImageSharp.Tests/TestUtilities/ImagingTestCaseUtility.cs
@@ -89,6 +89,8 @@ namespace SixLabors.ImageSharp.Tests
return $"{this.GetTestOutputDir()}/{this.TestName}{pixName}{fn}{details}{extension}";
}
+ private static string Inv(FormattableString formattable) => System.FormattableString.Invariant(formattable);
+
///
/// Gets the recommended file name for the output of the test
///
@@ -111,14 +113,16 @@ namespace SixLabors.ImageSharp.Tests
TypeInfo info = type.GetTypeInfo();
if (info.IsPrimitive || info.IsEnum || type == typeof(decimal))
{
- detailsString = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", testOutputDetails);
+ detailsString = Inv($"{testOutputDetails}");
}
else
{
IEnumerable properties = testOutputDetails.GetType().GetRuntimeProperties();
- detailsString = String.Join(
- "_", properties.ToDictionary(x => x.Name, x => string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", x.GetValue(testOutputDetails))).Select(x => $"{x.Key}-{x.Value}")
+ detailsString = string.Join(
+ "_",
+ properties.ToDictionary(x => x.Name, x => x.GetValue(testOutputDetails))
+ .Select(x => Inv($"{x.Key}-{x.Value}"))
);
}
}