Skip to content
Cyrille DUPUYDAUBY edited this page Feb 5, 2018 · 4 revisions

Properties

All characters properties are evaluated against Unicode.

IsALetter()

Checks that the sut is a letter; fails otherwise.

// this check succeeds
Check.That('b').IsALetter();
// this check fails
Check.That('4').IsALetter();

IsADigit()

Checks that the sut is a digit; fails otherwise.

// this check succeeds
Check.That('2').IsADigit();
// this check fails
Check.That('A').IsADigit();

IsAPunctuationMark()

Checks that the sut is a punctuation mark; fails otherwise.

// this check succeeds
Check.That(';').IsAPunctuationMark();
// this check fails
Check.That('A').IsAPunctuationMark();

Value

IsSameLetterAs(expected)

Checks that sut is the same letter than expected, disregarding case; fails otherwise. Note that expected must be a letter.

// this check succeeds
Check.That('a').IsSameLetterAs('A');
// this check fails
Check.That('2').IsSameLetterAs('2');

IsSameLetterButWithDifferentCase(expected)

Checks that sut is the same letter than expected, with a different case; fails otherwise. Note that expected must be a letter.

// this check succeeds
Check.That('a').IsSameLetterButWithDifferentCase('A');
// those checks fail
Check.That('2').IsSameLetterButWithDifferentCase('a');
Check.That('a').IsSameLetterButWithDifferentCase('a');
Clone this wiki locally