diff --git a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
index 210aa689a0..d3c7ec6916 100644
--- a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
@@ -929,23 +929,46 @@ public virtual void TearDown()
*/
TestResult result = TestExecutionContext.CurrentContext.CurrentResult;
- string message;
+
if (result.ResultState == ResultState.Failure || result.ResultState == ResultState.Error)
{
- message = result.Message + $"\n\nTo reproduce this test result:\n\n" +
- $"Option 1:\n\n" +
- $" Apply the following assembly-level attributes:\n\n" +
- $"[assembly: Lucene.Net.Util.RandomSeed(\"{RandomizedContext.CurrentContext.RandomSeedAsHex}\")]\n" +
- $"[assembly: NUnit.Framework.SetCulture(\"{Thread.CurrentThread.CurrentCulture.Name}\")]\n\n" +
- $"Option 2:\n\n" +
- $" Use the following .runsettings file:\n\n" +
- $"\n" +
- $" \n" +
- $" \n" +
- $" \n" +
- $" \n" +
- $"\n\n" +
- $"See the .runsettings documentation at: https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file.";
+ string message =
+ $$"""
+ {{result.Message}}
+
+ To reproduce this test result:
+
+ Option 1:
+
+ Apply the following assembly-level attributes:
+
+ [assembly: Lucene.Net.Util.RandomSeed("{{RandomizedContext.CurrentContext.RandomSeedAsHex}}")]
+ [assembly: NUnit.Framework.SetCulture("{{Thread.CurrentThread.CurrentCulture.Name}}")]
+
+ Option 2:
+
+ Use the following .runsettings file:
+
+
+
+
+
+
+
+
+ Option 3:
+
+ Create the following lucene.testsettings.json file somewhere between the test assembly and the root of your drive:
+
+ {
+ "tests": {
+ "seed": "{{RandomizedContext.CurrentContext.RandomSeedAsHex}}",
+ "culture": "{{Thread.CurrentThread.CurrentCulture.Name}}"
+ }
+ }
+
+ """;
+
result.SetResult(result.ResultState, message, result.StackTrace);
}
}