Skip to content

Add collection assertion ContainEquivalentOf#950

Merged
dennisdoomen merged 7 commits into
fluentassertions:masterfrom
matthiaslischka:master
Dec 15, 2018
Merged

Add collection assertion ContainEquivalentOf#950
dennisdoomen merged 7 commits into
fluentassertions:masterfrom
matthiaslischka:master

Conversation

@matthiaslischka

Copy link
Copy Markdown
Contributor

I gave #584 a try.
A new collection assertion named ContainEquivalentTo so a collection can be asserted to contain an object that "IsEquivalentTo" an expected object.
Not sure about the documentation. Could be enough, but not sure.

BR Matthias

@matthiaslischka
matthiaslischka force-pushed the master branch 2 times, most recently from 50f3573 to c8dd3a0 Compare October 18, 2018 12:04
asserts that a collection contains at least one object that is equivalent to the expected object.
@dennisdoomen dennisdoomen changed the title add collection assertion ContainEquivalentTo Add collection assertion ContainEquivalentTo Oct 20, 2018
@dennisdoomen dennisdoomen added this to the 5.5.0 milestone Oct 20, 2018

@dennisdoomen dennisdoomen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread Src/FluentAssertions/Collections/CollectionAssertions.cs Outdated
Comment thread Src/FluentAssertions/Collections/CollectionAssertions.cs Outdated
Comment thread Src/FluentAssertions/Collections/CollectionAssertions.cs Outdated
Comment thread Src/FluentAssertions/Collections/CollectionAssertions.cs
Comment thread Src/FluentAssertions/Collections/CollectionAssertions.cs Outdated
Comment thread Tests/Shared.Specs/CollectionAssertionSpecs.cs Outdated
@matthiaslischka matthiaslischka changed the title Add collection assertion ContainEquivalentTo Add collection assertion ContainEquivalentOf Oct 20, 2018
Comment thread Tests/Shared.Specs/CollectionAssertionSpecs.cs Outdated
Comment thread docs/_pages/documentation.md
Comment thread docs/_pages/documentation.md Outdated
@jnyrup jnyrup removed this from the 5.5.0 milestone Nov 8, 2018
Comment thread Tests/Shared.Specs/CollectionAssertionSpecs.cs Outdated
Comment thread Tests/Shared.Specs/CollectionAssertionSpecs.cs
Comment thread Tests/Shared.Specs/CollectionAssertionSpecs.cs
@dennisdoomen dennisdoomen self-assigned this Nov 29, 2018
Comment thread Src/FluentAssertions/Collections/CollectionAssertions.cs Outdated
Comment thread Src/FluentAssertions/Collections/CollectionAssertions.cs Outdated
@dennisdoomen

Copy link
Copy Markdown
Member

Just two typos. The rest looks good.

@jnyrup

jnyrup commented Dec 5, 2018

Copy link
Copy Markdown
Member

Should this be added to GenericDictionaryAssertions.cs as well?

@dennisdoomen

Copy link
Copy Markdown
Member

Should this be added to GenericDictionaryAssertions.cs as well?

To verify that a dictionary contains a key-value pair which value is equivalent to the provided expectation? Maybe, but I don't think it belongs in this PR. It's not a consistency thing IMO.

@jnyrup

jnyrup commented Dec 6, 2018

Copy link
Copy Markdown
Member

Ahh, yes of course.
I just searched for assertion classes exposing BeEquivalentTo, for consistency matters.

If one wants to assert that a dictionary contains an equivalent value, one can use

dictionary.Values.Should().ContainEquivalentOf(expected);

@dennisdoomen

Copy link
Copy Markdown
Member

So it seems we can merge this one.

@jnyrup

jnyrup commented Dec 6, 2018

Copy link
Copy Markdown
Member

I agree. I haven't been able to come up with a reason not to merge it.

@dennisdoomen
dennisdoomen merged commit 0702ef4 into fluentassertions:master Dec 15, 2018
@matthiaslischka

Copy link
Copy Markdown
Contributor Author

Hi, i just wanted to thank the two of you for your support with this PR. Especially @dennisdoomen, you made me realize just how much work maintaining an open source project is as you could have done this by yourself in no time but took the effort to support me in my doing. Thanks.

@dennisdoomen

Copy link
Copy Markdown
Member

Thanks for the kind words.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants