From 83053a35086931385ccfbdd0381b4f48d8057aaa Mon Sep 17 00:00:00 2001 From: Matthias Lischka Date: Sun, 21 Oct 2018 17:24:11 +0200 Subject: [PATCH] extend documentation of ContainEquivalentOf(object) --- docs/_pages/documentation.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/_pages/documentation.md b/docs/_pages/documentation.md index 58b62ed98f..5751c4a76c 100644 --- a/docs/_pages/documentation.md +++ b/docs/_pages/documentation.md @@ -484,6 +484,8 @@ collection.Should().NotBeAscendingInOrder(); collection.Should().NotBeDescendingInOrder(); ``` +The `collection.Should().ContainEquivalentOf(boxedValue)` asserts that a collection contains at least one object that is equivalent to the expected object. The comparison is governed by the same rules and options as the [Object graph comparison](#object-graph-comparison). + Those last two methods can be used to assert a collection contains items in ascending or descending order. For simple types that might be fine, but for more complex types, it requires you to implement `IComparable`, something that doesn't make a whole lot of sense in all cases. That's why we offer overloads that take an expression.