Skip to content

Conversation

AtolagbeMuiz
Copy link
Contributor

This Pull Request fixes Collection assert methods should accept IEnumerable collections #6184

This implementation creating a new of Assert member which are Assert.ContainsKey and Assert.ContainsValue which accepts non-generic IEnumerable key/value pair collection like HashTable.

Expected Behaviour of Assert.ContainsKey
These screenshots are examples of how Assert.ContainsKey can be used for non-generic key/value pair collection like HashTable

image image image

Expected Behaviour of Assert.ContainsValue
These screenshots are examples of how Assert.ContainsValue can be used for non-generic key/value pair collection like HashTable

image image image

Copy link
Member

@Youssef1313 Youssef1313 left a comment

Choose a reason for hiding this comment

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

Thanks for opening this PR!

However, I think in most cases users can simply use Assert.Contains(expected, collection.[Keys|Values]).

This feels to me low value to add, but I can discuss with rest of the team. Meanwhile, marking "requesting changes" to prevent accidental merge.

Copy link
Contributor

Hello @@AtolagbeMuiz,
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

@Youssef1313
Copy link
Member

@AtolagbeMuiz Sorry, it's automation comment. The PR so far is waiting on us deciding whether we want to add this API.

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

Successfully merging this pull request may close these issues.

Collection assert methods should accept IEnumerable collections
2 participants