From d8fed144a9316d9b46f6ea7835bdf14cbb1713ec Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Mon, 6 Jan 2025 21:54:13 +1100 Subject: [PATCH] fix context type in AddScrubber --- src/Directory.Build.props | 2 +- src/Verify.Tests/Serialization/EnsureScrubbingParameters.cs | 2 +- src/Verify/Serialization/Scrubbers/ApplyScrubbers.cs | 4 ++-- .../Scrubbers/VerifierSettings_GlobalScrubbers.cs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 4a1417bc0..3943b2ec3 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -2,7 +2,7 @@ CA1822;CS1591;CS0649;xUnit1026;xUnit1013;CS1573;VerifyTestsProjectDir;VerifySetParameters;PolyFillTargetsForNuget - 28.8.0 + 28.8.1 enable preview 1.0.0 diff --git a/src/Verify.Tests/Serialization/EnsureScrubbingParameters.cs b/src/Verify.Tests/Serialization/EnsureScrubbingParameters.cs index 3c80ae064..cced4d729 100644 --- a/src/Verify.Tests/Serialization/EnsureScrubbingParameters.cs +++ b/src/Verify.Tests/Serialization/EnsureScrubbingParameters.cs @@ -2,7 +2,7 @@ { [ModuleInitializer] public static void Initialize() => - VerifierSettings.AddScrubber((builder, counter, settings) => + VerifierSettings.AddScrubber((builder, counter, context) => { Assert.NotNull(counter); Assert.NotNull(settings); diff --git a/src/Verify/Serialization/Scrubbers/ApplyScrubbers.cs b/src/Verify/Serialization/Scrubbers/ApplyScrubbers.cs index 5420df83c..45ad20140 100644 --- a/src/Verify/Serialization/Scrubbers/ApplyScrubbers.cs +++ b/src/Verify/Serialization/Scrubbers/ApplyScrubbers.cs @@ -129,7 +129,7 @@ public static void ApplyForExtension(string extension, StringBuilder target, Ver foreach (var scrubber in VerifierSettings.GlobalScrubbers) { - scrubber(target, counter, settings); + scrubber(target, counter, settings.Context); } foreach (var replace in replacements) @@ -157,7 +157,7 @@ public static void ApplyForPropertyValue(VerifySettings settings, Counter counte foreach (var scrubber in VerifierSettings.GlobalScrubbers) { - scrubber(builder, counter, settings); + scrubber(builder, counter, settings.Context); } foreach (var replace in replacements) diff --git a/src/Verify/Serialization/Scrubbers/VerifierSettings_GlobalScrubbers.cs b/src/Verify/Serialization/Scrubbers/VerifierSettings_GlobalScrubbers.cs index a621da7ed..099736dce 100644 --- a/src/Verify/Serialization/Scrubbers/VerifierSettings_GlobalScrubbers.cs +++ b/src/Verify/Serialization/Scrubbers/VerifierSettings_GlobalScrubbers.cs @@ -2,7 +2,7 @@ public static partial class VerifierSettings { - internal static List> GlobalScrubbers = []; + internal static List>> GlobalScrubbers = []; /// /// Modify the resulting test content using custom code. @@ -19,7 +19,7 @@ public static void AddScrubber(Action scrubber, Scrubber /// /// Modify the resulting test content using custom code. /// - public static void AddScrubber(Action scrubber, ScrubberLocation location = ScrubberLocation.First) + public static void AddScrubber(Action> scrubber, ScrubberLocation location = ScrubberLocation.First) { InnerVerifier.ThrowIfVerifyHasBeenRun(); switch (location)