Skip to content

DictionaryContainsKeyValuePairConstraint supports generic IDictionary #4014

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

Merged
merged 4 commits into from
Dec 8, 2021

Conversation

louis-z
Copy link
Contributor

@louis-z louis-z commented Dec 3, 2021

  • Adapt DictionaryContainsKeyValuePairConstraint so that it works with types that implement
    • IDictionary<TKey, TValue> but
    • not IDictionary
  • For backward compatibility, keep throwing same exception with same message as before when a failures occurs

Fixes #3964

Copy link
Member

@mikkelbu mikkelbu left a comment

Choose a reason for hiding this comment

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

Looks good to me @louis-z. Thanks for the contribution. We will need one more review before merging this.

…nary

- Adapt DictionaryContainsKeyValuePairConstraint so that it works with types that implement
  - IDictionary<TKey, TValue> but
  - not IDictionary
- For backward compatibility, keep throwing same exceptions with same messages when failures arise
@louis-z
Copy link
Contributor Author

louis-z commented Dec 7, 2021

Looks good to me @louis-z. Thanks for the contribution. We will need one more review before merging this.

No problem, I was glad to help. 😉
I just added an assertion to my test, to make sure that looking up a non-existent KeyValuePair also works.

@mikkelbu mikkelbu merged commit 004e04a into nunit:master Dec 8, 2021
@louis-z louis-z deleted the issue-3964 branch December 9, 2021 12:37
rprouse added a commit that referenced this pull request Feb 21, 2023
Backport PR #4014 to fix Issue #3964 (DictionaryContainsKeyValuePairConstraint supports generic IDictionary)
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.

DictionaryContainsKeyValuePairConstraint doesn't work with IDictionary<TKey, TValue>
3 participants