Repository navigation
Clarify CollectionAssert.Contains parameters and failure message - #1272
Open
SeanKilleen wants to merge 2 commits into
Open
SeanKilleen wants to merge 2 commits into
SeanKilleen wants to merge 2 commits into
Conversation
`CollectionAssert.Contains` and `DoesNotContain` were listed with `(IEnumerable expected, object actual)`, but the real parameter names are `(IEnumerable collection, object actual)`. Fixes the signatures and adds a short section explaining that the second argument is the item being looked for, why it appears on the **Expected** line of the failure message, that passing a collection as the second argument looks for it as a single element, and that the constraint-based `Does.Contain`/`Has.Member` read more naturally. Fixes #672 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
📖 Docs preview: https://pr-1272.nunit-docs.pages.dev Built from 48422fd. This link always shows the latest build for this PR; the build for this exact commit is at https://11622bb3.nunit-docs.pages.dev. Previews are hosted on Cloudflare Pages, are not indexed by search engines, and are removed when the PR is closed. They omit the archived NUnit 2.x documentation (the |
stevenaw
reviewed
Oct 25, 2026
| IComparer comparer, string message, params object[] args); | ||
| ``` | ||
|
|
||
| ## Contains and DoesNotContain |
Member
There was a problem hiding this comment.
Thanks for putting a PR up for this one @SeanKilleen
I'll have to reacquaint myself with the issue before reviewing. Hopefully soon. I had thought we supported subset-style contains through this API too, but perhaps that's just at constraint level
…t-contains-parameters
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CollectionAssert.ContainsandDoesNotContainwere listed with(IEnumerable expected, object actual), but the real parameter names are(IEnumerable collection, object actual). Fixes the signatures and adds a short section explaining that the second argument is the item being looked for, why it appears on the Expected line of the failure message, that passing a collection as the second argument looks for it as a single element, and that the constraint-basedDoes.Contain/Has.Memberread more naturally.Fixes #672
🤖 Generated with Claude Code