VerifyTests/Verify

nUnit ScrubLinesContaining doesn't scrub lines with requested string

Muchaszewski opened this issue · 1 comments

Describe the bug

A clear and concise description of what the bug is. Include any relevant version information.
ScrubLinesContaining doesn't work as expected and no longer scrubs lines containing lines.

A clear and concise description of what you expected to happen.
ScrubLinesContaining should remove line containing a word

Add any other context about the problem here.
Worked correctly in 17.5.0 - after upgrade to 23.6.0 doesn't work as expected

Minimal Repro

Using nUnit and Verify.NUnit

[TestFixture]
public class VerifyTest
{
    [Test]
    public async Task Test()
    {
        var testResult = new
        {
            TestName = "Test",
            TestResult = "Pass",
            SessionToken = "token"
        };
        var settings = new VerifySettings();
        settings.ScrubLinesContaining("SessionToken");
        
        await Verify(testResult, settings);
    }
}

Result in 23.6.0

{
  TestName: Test,
  TestResult: Pass,
  SessionToken: token
}

Result in 17.5.0

{
  TestName: Test,
  TestResult: Pass,
}

try this

        [Test]
        public async Task Test()
        {
            var testResult = new
            {
                TestName = "Test",
                TestResult = "Pass",
                SessionToken = "token"
            };
            await Verify(testResult).IgnoreMember("SessionToken");
        }