-
Notifications
You must be signed in to change notification settings - Fork 53
Misc checks
Cyrille DUPUYDAUBY edited this page Feb 5, 2018
·
11 revisions
This page lists checks on various types.
Checks that the sut is true. Fails if false.
// this check succeeds
Check.That(true).IsTrue();
// this check fails
Check.That(false).IsTrue);
Checks that the sut is false. Fails if true.
// this check succeeds
Check.That(false).IsFalse();
// this check fails
Check.That(true).IsFalse);
Checks that the sut represents a duration which is shorter than the expected duration; fails if longer or equal. Uses the TimeUnit to express the unit of time in which the duration is expressed.
// This check succeeds.
Check.That(TimeSpan.FromSeconds(2)).IsLessThan(3, TimeUnit.Seconds);
// This check fails
Check.That(TimeSpan.FromDays(2)).IsLessThan(1, TimeUnit.Hours);
```
- 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