Skip to content

Commit

Permalink
fix context type in AddScrubber
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Jan 6, 2025
1 parent 50ba6b3 commit d8fed14
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project>
<PropertyGroup>
<NoWarn>CA1822;CS1591;CS0649;xUnit1026;xUnit1013;CS1573;VerifyTestsProjectDir;VerifySetParameters;PolyFillTargetsForNuget</NoWarn>
<Version>28.8.0</Version>
<Version>28.8.1</Version>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>preview</LangVersion>
<AssemblyVersion>1.0.0</AssemblyVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/Verify/Serialization/Scrubbers/ApplyScrubbers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public static partial class VerifierSettings
{
internal static List<Action<StringBuilder, Counter, VerifySettings>> GlobalScrubbers = [];
internal static List<Action<StringBuilder, Counter, IReadOnlyDictionary<string, object>>> GlobalScrubbers = [];

/// <summary>
/// Modify the resulting test content using custom code.
Expand All @@ -19,7 +19,7 @@ public static void AddScrubber(Action<StringBuilder, Counter> scrubber, Scrubber
/// <summary>
/// Modify the resulting test content using custom code.
/// </summary>
public static void AddScrubber(Action<StringBuilder, Counter, VerifySettings> scrubber, ScrubberLocation location = ScrubberLocation.First)
public static void AddScrubber(Action<StringBuilder, Counter, IReadOnlyDictionary<string, object>> scrubber, ScrubberLocation location = ScrubberLocation.First)
{
InnerVerifier.ThrowIfVerifyHasBeenRun();
switch (location)
Expand Down

0 comments on commit d8fed14

Please sign in to comment.