char implements IComparable<char>, but ThatChar has no range expectation. Ranges without a named BCL counterpart currently require .Satisfies(c => c is >= 'Ѐ' and <= 'ӿ'), which produces a poor failure message, and IsOneOf is impractical for contiguous ranges.
Use cases not covered by the existing expectations:
- Unicode block membership (e.g. Cyrillic
'Ѐ'..'ӿ') or a custom alphabet
- Contiguous ranges too large to enumerate with
IsOneOf ('a'..'z' is 26 arguments, and IsALetter() is Unicode-wide so it means something different)
Proposed API
Mirrors ThatTimeSpan.IsBetween:
await Expect.That(subject).IsBetween('a').And('z');
Deliberately not adding IsGreaterThan / IsLessThan etc.: the concrete cases for those (ASCII digit, hex digit, upper/lower case) are better served by named predicates — see the companion issue — and comparison operators on char read poorly in failure messages. No .Within() tolerance overloads.
charimplementsIComparable<char>, butThatCharhas no range expectation. Ranges without a named BCL counterpart currently require.Satisfies(c => c is >= 'Ѐ' and <= 'ӿ'), which produces a poor failure message, andIsOneOfis impractical for contiguous ranges.Use cases not covered by the existing expectations:
'Ѐ'..'ӿ') or a custom alphabetIsOneOf('a'..'z'is 26 arguments, andIsALetter()is Unicode-wide so it means something different)Proposed API
Mirrors
ThatTimeSpan.IsBetween:Deliberately not adding
IsGreaterThan/IsLessThanetc.: the concrete cases for those (ASCII digit, hex digit, upper/lower case) are better served by named predicates — see the companion issue — and comparison operators oncharread poorly in failure messages. No.Within()tolerance overloads.