From da8db1590f05c8a4380dd38c953a14fbe697490c Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Sat, 3 Feb 2024 20:52:22 +1100 Subject: [PATCH] add missing scrubbing overloads (#1138) --- src/Directory.Build.props | 2 +- src/Verify/SettingsTask_Scrubbing.cs | 90 ++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 1 deletion(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 7ec3650ca..82ecd2e09 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -2,7 +2,7 @@ CS1591;CS0649;xUnit1026;xUnit1013;CS1573;VerifyTestsProjectDir;VerifySetParameters - 23.0.1 + 23.1.0 enable preview 1.0.0 diff --git a/src/Verify/SettingsTask_Scrubbing.cs b/src/Verify/SettingsTask_Scrubbing.cs index 6de6a58c7..0826f0be8 100644 --- a/src/Verify/SettingsTask_Scrubbing.cs +++ b/src/Verify/SettingsTask_Scrubbing.cs @@ -32,6 +32,16 @@ public SettingsTask ScrubInlineGuids(ScrubberLocation location = ScrubberLocatio return this; } + /// + /// Replace inline s with a placeholder. + /// + [Pure] + public SettingsTask ScrubInlineGuids(string extension, ScrubberLocation location = ScrubberLocation.First) + { + CurrentSettings.ScrubInlineGuids(extension, location); + return this; + } + /// /// Disables counting of dates. /// @@ -86,6 +96,16 @@ public SettingsTask ScrubMachineName(ScrubberLocation location = ScrubberLocatio return this; } + /// + /// Remove the from the test results. + /// + [Pure] + public SettingsTask ScrubMachineName(string extension, ScrubberLocation location = ScrubberLocation.First) + { + CurrentSettings.ScrubMachineName(extension, location); + return this; + } + /// /// Remove the from the test results. /// @@ -96,6 +116,16 @@ public SettingsTask ScrubUserName(ScrubberLocation location = ScrubberLocation.F return this; } + /// + /// Remove the from the test results. + /// + [Pure] + public SettingsTask ScrubUserName(string extension,ScrubberLocation location = ScrubberLocation.First) + { + CurrentSettings.ScrubUserName(extension, location); + return this; + } + /// /// Remove any lines containing any of from the test results. /// @@ -105,6 +135,15 @@ public SettingsTask ScrubLinesContaining(StringComparison comparison, params str CurrentSettings.ScrubLinesContaining(comparison, stringToMatch); return this; } + /// + /// Remove any lines containing any of from the test results. + /// + [Pure] + public SettingsTask ScrubLinesContaining(string extension, StringComparison comparison, params string[] stringToMatch) + { + CurrentSettings.ScrubLinesContaining(extension, comparison, stringToMatch); + return this; + } /// /// Remove any lines containing any of from the test results. @@ -116,6 +155,16 @@ public SettingsTask ScrubLinesContaining(StringComparison comparison, ScrubberLo return this; } + /// + /// Remove any lines containing any of from the test results. + /// + [Pure] + public SettingsTask ScrubLinesContaining(string extension, StringComparison comparison, ScrubberLocation location = ScrubberLocation.First, params string[] stringToMatch) + { + CurrentSettings.ScrubLinesContaining(extension, comparison, location, stringToMatch); + return this; + } + /// /// Remove any lines matching from the test results. /// @@ -126,6 +175,16 @@ public SettingsTask ScrubLines(Func removeLine, ScrubberLocation l return this; } + /// + /// Remove any lines matching from the test results. + /// + [Pure] + public SettingsTask ScrubLines(string extension, Func removeLine, ScrubberLocation location = ScrubberLocation.First) + { + CurrentSettings.ScrubLines(extension, removeLine, location); + return this; + } + /// /// Scrub lines with an optional replace. /// can return the input to ignore the line, or return a different string to replace it. @@ -137,6 +196,17 @@ public SettingsTask ScrubLinesWithReplace(Func replaceLine, Scr return this; } + /// + /// Scrub lines with an optional replace. + /// can return the input to ignore the line, or return a different string to replace it. + /// + [Pure] + public SettingsTask ScrubLinesWithReplace(string extension, Func replaceLine, ScrubberLocation location = ScrubberLocation.First) + { + CurrentSettings.ScrubLinesWithReplace(extension, replaceLine, location); + return this; + } + /// /// Remove any lines containing only whitespace from the test results. /// @@ -147,6 +217,16 @@ public SettingsTask ScrubEmptyLines(ScrubberLocation location = ScrubberLocation return this; } + /// + /// Remove any lines containing only whitespace from the test results. + /// + [Pure] + public SettingsTask ScrubEmptyLines(string extension, ScrubberLocation location = ScrubberLocation.First) + { + CurrentSettings.ScrubEmptyLines(extension, location); + return this; + } + /// /// Remove any lines containing any of from the test results. /// @@ -166,4 +246,14 @@ public SettingsTask ScrubLinesContaining(ScrubberLocation location = ScrubberLoc CurrentSettings.ScrubLinesContaining(location, stringToMatch); return this; } + + /// + /// Remove any lines containing any of from the test results. + /// + [Pure] + public SettingsTask ScrubLinesContaining(string extension, ScrubberLocation location = ScrubberLocation.First, params string[] stringToMatch) + { + CurrentSettings.ScrubLinesContaining(extension, location, stringToMatch); + return this; + } } \ No newline at end of file