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

Map.contains(Only)EntriesOf #173

Closed
robstoll opened this issue Oct 3, 2019 · 3 comments · Fixed by #726
Closed

Map.contains(Only)EntriesOf #173

robstoll opened this issue Oct 3, 2019 · 3 comments · Fixed by #726
Assignees
Labels
help wanted needs votes otherwise it will be ignored
Milestone

Comments

@robstoll
Copy link
Owner

robstoll commented Oct 3, 2019

Platform (jvm, jdk8, js, android):

Code related feature

expect(map).containsEntriesOf(otherMap)

I suggest that we also introduce a builder if we add this:

expect(map).contains.inAnyOrder.entriesOf(...)

Which then should be extended with

expect(map).contains.inAnyOrder.keyValuePair(Pair<..., ...>)
expect(map).contains.inAnyOrder.keyValuePairs(Pair<..., ...>, vararg Pair<..., ...>)
expect(map).contains.inAnyOrder.keyValue(KeyValue<..., ...>)
expect(map).contains.inAnyOrder.keyValues(KeyValue<..., ...>, vararg <..., ...>)

And we could extend it further with (please in a second PR, relates to #68, see requirements for reporting there):

expect(map).contains.inAnyOrder.only.entriesOf(Map<..., ...>)
expect(map).contains.inAnyOrder.only.keyValuePair(Pair<..., ...>)
expect(map).contains.inAnyOrder.only.keyValuePairs(Pair<..., ...>, vararg Pair<..., ...>)
expect(map).contains.inAnyOrder.only.keyValue(KeyValue<..., ...>)
expect(map).contains.inAnyOrder.only.keyValues(KeyValue<..., ...>, vararg <..., ...>)

expect(map).contains.inOrder.only.entriesOf(Map<..., ...>)
expect(map).contains.inOrder.only.keyValuePair(Pair<..., ...>)
expect(map).contains.inOrder.only.keyValuePairs(Pair<..., ...>, vararg Pair<..., ...>)
expect(map).contains.inOrder.only.keyValue(KeyValue<..., ...>)
expect(map).contains.inOrder.only.keyValues(KeyValue<..., ...>, vararg <..., ...>)

Please react with 👍 if you want to see containsEntriesOf implemented in Atrium, the more upvotes the more likely I will implement it myself -- feel free to sponsor me, that would be a motivation too.
You are of course welcome to work on this issue. Write I'll work on it as comment so that we can assign the task to you.
And if you have already a use case in mind, then it would be great if you share it via comment.

@robstoll robstoll added the needs votes otherwise it will be ignored label Oct 3, 2019
Repository owner deleted a comment from piyushmor Oct 25, 2019
@robstoll
Copy link
Owner Author

@piyushmor thanks for your feedback, I deleted your comment as I don't want to encourage people writing a comment with a single 👍 (otherwise this issue gets cluttered). I prefer the reaction.
Btw. if you know other people wanting this feature then encourage them to react with 👍 as well.

@robstoll robstoll added help wanted needs votes otherwise it will be ignored and removed needs votes otherwise it will be ignored labels Jan 10, 2020
@robstoll robstoll added this to the 0.15.0 milestone Nov 19, 2020
@robstoll robstoll self-assigned this Nov 19, 2020
@robstoll robstoll changed the title Map.containsEntriesOf Map.contains(Only)EntriesOf Dec 21, 2020
@robstoll
Copy link
Owner Author

I'll also add a shortcut for contains o inAny order but only entriesOf mapLike named containsOnlyEntriesOf

@robstoll
Copy link
Owner Author

@piyushmor, @StragaSevera and @igorakkerman, pinging you guys because you voted for the issue. It is now available in Atrium 0.15.0 please let us know in case you miss something about this feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted needs votes otherwise it will be ignored
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant