Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add collection assertion ContainEquivalentOf #950

Merged
merged 7 commits into from Dec 15, 2018

Conversation

matthiaslischka
Copy link
Contributor

@matthiaslischka matthiaslischka commented Oct 18, 2018

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 Oct 18, 2018
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
Copy link
Member

@dennisdoomen dennisdoomen left a comment

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

dennisdoomen commented Nov 30, 2018

Just two typos. The rest looks good.

@jnyrup
Copy link
Member

jnyrup commented Dec 5, 2018

Should this be added to GenericDictionaryAssertions.cs as well?

@dennisdoomen
Copy link
Member

dennisdoomen commented Dec 6, 2018

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
Copy link
Member

jnyrup commented Dec 6, 2018

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
Member

dennisdoomen commented Dec 6, 2018

So it seems we can merge this one.

@jnyrup
Copy link
Member

jnyrup commented Dec 6, 2018

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
1 check passed
@matthiaslischka
Copy link
Contributor Author

matthiaslischka commented Dec 15, 2018

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
Member

dennisdoomen commented Dec 15, 2018

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.

None yet

3 participants