Description
The assertion library has HasLength(int length) for exact length matching but lacks range-based assertions:
HasMinLength(int minLength) — assert string is at least N characters
HasMaxLength(int maxLength) — assert string is at most N characters
HasLengthBetween(int min, int max) — assert string length is within a range
Why
These are common validation patterns (password lengths, field constraints, etc.). Currently users must chain verbose comparisons like .HasLength().IsGreaterThanOrEqualTo(8).And.IsLessThanOrEqualTo(16).
Suggested Approach
Add three new assertion classes using the [GenerateAssertion] pattern where possible.
Description
The assertion library has
HasLength(int length)for exact length matching but lacks range-based assertions:HasMinLength(int minLength)— assert string is at least N charactersHasMaxLength(int maxLength)— assert string is at most N charactersHasLengthBetween(int min, int max)— assert string length is within a rangeWhy
These are common validation patterns (password lengths, field constraints, etc.). Currently users must chain verbose comparisons like
.HasLength().IsGreaterThanOrEqualTo(8).And.IsLessThanOrEqualTo(16).Suggested Approach
Add three new assertion classes using the
[GenerateAssertion]pattern where possible.