Skip to content

Char Assertions #2315

@thomhurst

Description

@thomhurst

Discussed in #2314

Originally posted by AnnaSasDev May 2, 2025
For a highly specific thing, whih might be better built differently but that is besides the point of this discussion, I wanted to do something like the folloing (tiny example):

char a = 'a'
await Assert.That(a).IsDigit()

But I didnt find any assertions for this already in TUnit, so I wanted to put out some feelers out if this is something that could be implemented? If so, I would love to work on it, and I would probably want to implement the ones that are direct takeovers from in the standard library on the char type, and their IsNot... variants:

  • IsAscii
  • IsAsciiDigit
  • IsAsciiLetterLower
  • IsAsciiLetterUpper
  • IsAsciiLetterOrDigit
  • IsAsciiHexDigit
  • IsAsciiHexDigitUpper
  • IsAsciiHexDigitLower
  • IsDigit
  • IsBetween
  • IsLetter
  • IsWhiteSpace
  • IsUpper
  • IsLower
  • IsPunctuation
  • IsLetterOrDigit
  • IsControl
  • IsNumber
  • IsSeparator
  • IsSurrogate
  • IsSymbol
  • IsHighSurrogate
  • IsLowSurrogate

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions