-
Notifications
You must be signed in to change notification settings - Fork 53
Reference types
Cyrille DUPUYDAUBY edited this page Feb 2, 2018
·
6 revisions
The following checks are available only for reference types.
Checks if a given instance is the same reference than a given instance. Fails otherwise
var sut = new MyClass();
// This check succeeds
Check.That(sut).IsSameReferenceAs(sut);
// This checks fails
Check.That(sut).IsSameReferenceAs(new object());
Checks if a given instance is a different reference than a given instance. Fails otherwise.
var sut = new MyClass();
// This check succeeds
Check.That(sut).IsDistinctFrom(new object());
// This checks fails
Check.That(sut).IsDistinctFrom(sut);
- 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