Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Jan 1, 2025
1 parent e6532dc commit c9f08e2
Show file tree
Hide file tree
Showing 2 changed files with 196 additions and 203 deletions.
21 changes: 21 additions & 0 deletions src/Verify.Tests/DateFormatLengthCalculatorTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
public class DateFormatLengthCalculatorTests
{
[Theory]
[InlineData("y", 4, 1)]
[InlineData("yy", 4, 2)]
[InlineData("yyy", 4, 3)]
[InlineData("yyyy", 4, 4)]
[InlineData("yyyyy", 5, 5)]
[InlineData("d", 2, 1)]
[InlineData("dd", 2, 2)]
[InlineData("ddd", 3, 3)]
[InlineData("dddd", 9, 4)]
[InlineData("ddddd", 9, 5)]
[InlineData("yyyy-MM-dd", 10, 10)]
public void Combos(string format, int max, int min)
{
var length = DateFormatLengthCalculator.GetLength(format.AsSpan(), CultureInfo.InvariantCulture);
Assert.Equal(max, length.max);
Assert.Equal(min, length.min);
}
}
Loading

0 comments on commit c9f08e2

Please sign in to comment.