diff --git a/docs/mdsource/recording.source.md b/docs/mdsource/recording.source.md index 37924ca8f7..f543c2fde9 100644 --- a/docs/mdsource/recording.source.md +++ b/docs/mdsource/recording.source.md @@ -51,6 +51,8 @@ To avoid grouping use [Stop](#stop). Recording can be grouped by an identifier. +The identifier should be statically unique. For example a fully qualified test name or a GUID. + snippet: RecordingIdentifier Results in: diff --git a/docs/recording.md b/docs/recording.md index d0b953faaf..137857f7ac 100644 --- a/docs/recording.md +++ b/docs/recording.md @@ -143,6 +143,8 @@ To avoid grouping use [Stop](#stop). Recording can be grouped by an identifier. +The identifier should be statically unique. For example a fully qualified test name or a GUID. + ```cs diff --git a/src/Directory.Build.props b/src/Directory.Build.props index e6c52e3232..6387a9dbf1 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -2,7 +2,7 @@ CS1591;CS0649;xUnit1026;xUnit1013;CS1573;VerifyTestsProjectDir;VerifySetParameters;PolyFillTargetsForNuget - 26.1.1 + 26.1.2 enable preview 1.0.0 diff --git a/src/Verify/Recording/Recording_Named.cs b/src/Verify/Recording/Recording_Named.cs index a9b436e66f..00c6232ce9 100644 --- a/src/Verify/Recording/Recording_Named.cs +++ b/src/Verify/Recording/Recording_Named.cs @@ -2,6 +2,8 @@ public static partial class Recording { + // The identifier should be statically unique. For example a fully qualified test name or a GUID. + // so it is ok for this to be shared state static ConcurrentDictionary namedState = new(StringComparer.OrdinalIgnoreCase); public static void Add(string identifier, string name, object item) =>