Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect scrubbing of DateTime #1368

Open
greri-tricentis opened this issue Dec 11, 2024 · 1 comment
Open

Incorrect scrubbing of DateTime #1368

greri-tricentis opened this issue Dec 11, 2024 · 1 comment

Comments

@greri-tricentis
Copy link

When the culture is set to en-US

and I do

[Test]
public Task TestScrubberOfDates() {
    var settings = new VerifySettings();
    settings.ScrubInlineDateTimes("G");
    return Verify("12/11/2024 10:36:43 AM", settings);
}

then I receive

1DateTime_1

I did however expect it to yield

DateTime_1

This is because the "Long" Date in this Class has a 9

static IReadOnlyDictionary<string, CultureDate> cultureDates = new Dictionary<string, CultureDate>()

But a date with a 9 is not as long as it could be. So it will not recognize 12/11/2024 10:36:43 AM as a datetime as its too long.
It will however find 2/11/2024 10:36:43 AM and scrub that.

@SimonCropp
Copy link
Member

can u submit a failing unit test as a pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants