Implement NotBeEquivalent for objects (fixes #170)#1071
Implement NotBeEquivalent for objects (fixes #170)#1071dennisdoomen merged 2 commits intofluentassertions:masterfrom
Conversation
|
The implementation looks good to me, but I think we may need to be careful here.
"AA".Should().BeEquivalentTo("BB"); // StringAssertions
"AA".Should().NotBeEquivalentTo("BB"); // does not exists
new object().Should().BeEquivalentTo(new object()); // Object Assertions
new object().Should().NotBeEquivalentTo(new object()); // does not exists, but would exist with this PR
new[] { "AA" }.Should().BeEquivalentTo(new[] { "BB" }); // StringCollectionAssertions
new[] { "AA" }.Should().NotBeEquivalentTo(new[] { "BB" }); // CollectionAssertions
new[] { 1 }.Should().BeEquivalentTo(new[] { 2 }); // GenericCollectionAssertions
new[] { 1 }.Should().NotBeEquivalentTo(new[] { 2 }); // CollectionAssertions
new Dictionary<int, int>().Should().BeEquivalentTo(1); // GenericDictionaryAssertions
new Dictionary<int, int>().Should().NotBeEquivalentTo(1); // does not exists
new ComparableOfInt(1).Should().BeEquivalentTo(1); // ComparableTypeAssertions
new ComparableOfInt(1).Should().NotBeEquivalentTo(1); // does not exists |
|
Currently there are some overloads for NotEquivalent, some are missing. |
|
Had a deeper look at the inheritance graphs. So no objections anyway 👍 |
dennisdoomen
left a comment
There was a problem hiding this comment.
Looks good. Can you also please update the docs?
|
I added small portion of documentation. |
Is this the right way?
Fixes #170