Char
Describes the possible expectations for char
values.
Equality
You can verify that the char
is equal to another one.
char subject = 'a';
await Expect.That(subject).IsEqualTo('a');
await Expect.That(subject).IsNotEqualTo('b');
One of
You can verify that the char
is one of many alternatives.
char subject = 'a';
await Expect.That(subject).IsOneOf('a', 'b', 'c');
await Expect.That(subject).IsNotOneOf('x', 'y', 'z');
Is
An ASCII letter
You can verify that the char
is an ASCII letter.
await Expect.That('a').IsAnAsciiLetter();
This verifies that the subject is an ASCII letter
(see char.IsAsciiLetter(char)
).
A letter
You can verify that the char
is a letter.
await Expect.That('a').IsALetter();
await Expect.That('乐').IsALetter();
This verifies that the subject is categorized as a Unicode letter
(see char.IsLetter(char)
).