Visitar URL original
BeEmpty for IEnumerable<T> assertions now lists the first 10 items in… by Xceed-DelvaJB · Pull Request #3198 · fluentassertions/fluentassertions · GitHub
Skip to content

BeEmpty for IEnumerable<T> assertions now lists the first 10 items in… - #3198

Merged
dennisdoomen merged 9 commits into
fluentassertions:mainfrom
Xceed-DelvaJB:2782
May 19, 2026
Merged

dennisdoomen merged 9 commits into
fluentassertions:mainfrom
Xceed-DelvaJB:2782

Conversation

@Xceed-DelvaJB

Copy link
Copy Markdown
Contributor

… the collection instead of only the first one.

Resolves #2782.

IMPORTANT

  • If the PR touches the public API, the changes have been approved in a separate issue with the "api-approved" label.
  • The code complies with the Coding Guidelines for C#.
  • The changes are covered by unit tests which follow the Arrange-Act-Assert syntax and the naming conventions such as is used in these tests.
  • If the PR adds a feature or fixes a bug, please update the release notes with a functional description that explains what the change means to consumers of this library, which are published on the website.
  • If the PR changes the public API the changes needs to be included by running AcceptApiChanges.ps1 or AcceptApiChanges.sh.
  • If the PR affects the documentation, please include your changes in this pull request so the documentation will appear on the website.
  • Please also run ./build.sh --target spellcheck or .\build.ps1 --target spellcheck before pushing and check the good outcome

CONTRIBUTOR LICENSE GRANT

By submitting this contribution, the contributor hereby irrevocably grants to the project owners and maintainers a perpetual, worldwide, royalty-free, irrevocable license to use, reproduce, modify, distribute, sublicense, and create derivative works of the contribution for any purpose and under any terms, including proprietary licensing.

The contributor waives any moral rights in the contribution to the extent permitted by law and agrees not to assert any claim of authorship or control over the contribution. The contributor represents that they are the sole author of the contribution and that it is provided free of any third-party claims.

The contributor understands and agrees that the maintainers may, at their sole discretion, use, license, or redistribute the contribution as part of any work and under any terms they choose, without further permission or attribution.

  • I have read the Contributor License Grant and accept the conditions
  • I'm interested in a free license for Fluent Assertions and will share my email address through sales@xceed.com

… the collection instead of only the first one.
@github-actions

Copy link
Copy Markdown

Qodana for .NET

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates BeEmpty() failure output for IEnumerable<T> collection assertions so failures include up to the first 10 items (instead of just the first), improving diagnostics and aligning with the requested behavior in #2782.

Changes:

  • Update IEnumerable<T>.BeEmpty() to capture and report up to 10 items in the failure message.
  • Adjust existing specs’ expected messages to match the new output.
  • Add a new spec validating the 10-item cap and document the change in the release notes.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
docs/_pages/releases.md Adds an Unreleased note describing the improved BeEmpty() diagnostics.
Src/FluentAssertions/Collections/GenericCollectionAssertions.cs Changes BeEmpty() to take/print up to 10 items instead of 1.
Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEmpty.cs Updates message expectations and adds a test covering the 10-item limit.
Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEmpty.cs Updates BeEmpty() failure-message expectation for string collections.
Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.BeEmpty.cs Updates dictionary BeEmpty() failure-message expectation to match new wording.
Tests/FluentAssertions.Specs/Primitives/ReferenceTypeAssertionsSpecs.cs Updates expected multiline formatting for BeEmpty() failure output.

Comment thread docs/_pages/releases.md Resolved
@dennisdoomen

Copy link
Copy Markdown
Member

@Xceed-DelvaJB did you see the review comments and failing builds?

Xceed-DelvaJB and others added 2 commits May 7, 2026 01:20
Added link to the issue.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ecs.BeEmpty.cs


Added assertion that collection.GetEnumeratorCallCount should be 1.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented May 7, 2026 •

Copy link
Copy Markdown

Qodana for .NET

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

Comment thread docs/_pages/releases.md Resolved
Xceed-DelvaJB and others added 3 commits May 17, 2026 21:35
Fixed link in release notes.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dennisdoomen
dennisdoomen requested a review from jnyrup May 19, 2026 09:04
This was referenced Nov 12, 2026
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.

BeEmpty() no longer lists all items in the collection in the error message

4 participants