Repository navigation
Strings
Cyrille DUPUYDAUBY edited this page Feb 4, 2018
·
6 revisions
Checks if the string is empty, fails if null or not empty.
// this check succeeds
Check.That("").IsEmpty();
// this check fails
Check.That("test").IsEmpty;Checks if the string is empty or is null, fails if not empty.
// this check succeeds
Check.That("").IsNullOrEmpty();
// this check fails
Check.That("test").IsNullOrEmpty;Checks if the string does contain texts, fails if empty or null.
// those checks succeed
Check.That("test").IsNotEmpty();
Check.That("test").HasContent();
// those checks fail
Check.That("").IsNotEmpty;
Check.That("").HasContent;Checks that the sut contains expected, fails if expected is not found.
// those checks succeed
Check.That("this is a test").Contains("test");
// those checks fail
Check.That("this is a test").Contains("check");Checks that the sut does not contain reference, fails if reference is found.
// those checks succeed
Check.That("this is a test").Contains("check");
// those checks fail
Check.That("this is a test").Contains("test");- Welcome
- How to start
- Customising error messages
-
Check.That
- All (Equality, Type)
- Reference types
- Members based
- IEnumerable (Properties, Content, Elements)
- String (Properties, Content, RegExp )
- Numeric Type(Properties, Comparisons, Floating)
- Dictionary
- Char (Properties, Value)
- IComparable
- DateTime
- DateTimeOffset
- Misc: Boolean, TimeSpan, Stream, Enum, EventWaitHandle
- Check.ThatCode
- Check.ThatDynamic
- Extensibility
- Auxiliary types (TimeUnit)
- Mocks