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

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

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

Choose a reason for hiding this comment

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

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
@dennisdoomen dennisdoomen self-assigned this Nov 29, 2018
@dennisdoomen
Copy link
Member

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

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

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
@matthiaslischka
Copy link
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
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.

None yet

3 participants