Skip to content

Commit

Permalink
Update DateScrubberTests.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Feb 14, 2025
1 parent 9c58617 commit c5d8d6e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Verify.Tests/DateScrubberTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,19 @@ await Verify(builder)
[Fact]
public void ReplaceDateTimes_AllCultures()
{
var format = "yyyy MMMM MMM MM dddd ddd dd d HH H mm m ss s fffff tt";
foreach (var culture in CultureInfo.GetCultures(CultureTypes.AllCultures))
{
var format = "yyyy MMMM MMM MM dddd ddd dd d HH H mm m ss s fffff tt";
var counter = Counter.Start();
var dateTime = DateTime.Now;

var dateFormat = culture.DateTimeFormat;
if (dateFormat.AMDesignator.Length == 0 &&
dateFormat.PMDesignator.Length == 0)
{
format = format.Replace(" tt", "");
}

var value = dateTime.ToString(format, culture);
var builder = new StringBuilder(value);
DateScrubber.ReplaceDateTimes(builder, format, counter, culture);
Expand Down

0 comments on commit c5d8d6e

Please sign in to comment.