Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Extend collection assertions with ContainInConsecutiveOrder and NotContainInConsecutiveOrder - #1963

#1963
Merged
dennisdoomen merged 19 commits into
fluentassertions:developfluentassertions/fluentassertions:developfrom
StacyCash:developStacyCash/fluentassertions:developCopy head branch name to clipboard
Aug 9, 2022
Merged

Extend collection assertions with ContainInConsecutiveOrder and NotContainInConsecutiveOrder#1963
dennisdoomen merged 19 commits into
fluentassertions:developfluentassertions/fluentassertions:developfrom
StacyCash:developStacyCash/fluentassertions:developCopy head branch name to clipboard

Conversation

@StacyCash

@StacyCash StacyCash commented Jul 26, 2022

Copy link
Copy Markdown
Contributor

Adds ContainInConsecutiveOrder and NotContainInConsecutiveOrder to check that a collection is contained within another in order and with no gaps.

This will close #1956

IMPORTANT

  • 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.

Two functions to check that a cleections contains or doesn't contain the items from a second collections consecutively.
Comment thread Src/FluentAssertions/Collections/GenericCollectionAssertions.cs Outdated
@jnyrup jnyrup changed the title Extend GenericCollectionAssertions for ContainsInConsecutiveOrder and NotContainsInConsecutiveOrder Extend GenericCollectionAssertions for ContainInConsecutiveOrder and NotContainInConsecutiveOrder Jul 26, 2022
Comment thread docs/_pages/releases.md Outdated
Comment thread docs/_pages/releases.md Outdated
@StacyCash
StacyCash requested a review from jnyrup July 26, 2022 13:57
@dennisdoomen dennisdoomen changed the title Extend GenericCollectionAssertions for ContainInConsecutiveOrder and NotContainInConsecutiveOrder Extend collection assertions with ContainInConsecutiveOrder and NotContainInConsecutiveOrder Jul 27, 2022
@coveralls

coveralls commented Jul 27, 2022

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 2754590099

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+1.0%) to 96.654%

Totals Coverage Status
Change from base Build 2726577378: 1.0%
Covered Lines: 12302
Relevant Lines: 12568

💛 - Coveralls

@jnyrup jnyrup left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The code coverage reports two branch misses.
If you login to coveralls.io with with your github account, you can inspect the report there.
Alternatively you can run ./build.ps1 locally and look inTestResults\reports\index.html.

Do you intend to apply the optimizations I suggested in #1956 (comment)?
I should not be necessary to do any calls ToArray().
If you prefer, I can also have a look at that. Just let me know.

Comment thread Src/FluentAssertions/Collections/GenericCollectionAssertions.cs Outdated
Comment thread Src/FluentAssertions/Collections/GenericCollectionAssertions.cs Outdated
Comment thread Src/FluentAssertions/Collections/GenericCollectionAssertions.cs
Comment thread Src/FluentAssertions/Collections/GenericCollectionAssertions.cs Outdated

@dennisdoomen dennisdoomen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the contribution.

Comment thread Src/FluentAssertions/Collections/GenericCollectionAssertions.cs
@StacyCash

Copy link
Copy Markdown
Contributor Author

@jnyrup I've looked at your changes and rewritten both the ContainsInConsecutitveOrder and NotContainsInConsecutiveOrder based it. Thanks! They are both much easier to read now.

@StacyCash
StacyCash requested review from dennisdoomen and jnyrup July 28, 2022 14:51
@jnyrup

jnyrup commented Jul 28, 2022

Copy link
Copy Markdown
Member

Major improvement!
Now I only have a few styling comments.

I haven't looked deeply into the tests, but it seems we could use a test when calling with an empty expected/unexpected.

@StacyCash

Copy link
Copy Markdown
Contributor Author

There is an empty test for NotContainsInConsecuritveOrder, I've added the same for ContainsInConsecutiveOrder

If you let me know the style issues I'll either look at them in the morning or when I return.

@jnyrup jnyrup left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If you let me know the style issues I'll either look at them in the morning or when I return.

The style comments were still pending 🤦‍♂️

Comment thread Src/FluentAssertions/Collections/GenericCollectionAssertions.cs Outdated
Comment thread Src/FluentAssertions/Collections/GenericCollectionAssertions.cs Outdated
Comment thread Src/FluentAssertions/Collections/GenericCollectionAssertions.cs Outdated
StacyCash and others added 3 commits August 1, 2022 11:54
Co-authored-by: Jonas Nyrup <jnyrup@users.noreply.github.com>
Co-authored-by: Jonas Nyrup <jnyrup@users.noreply.github.com>
Co-authored-by: Jonas Nyrup <jnyrup@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend GenericCollectionAssertions to include a ContainInConsecutiveOrder

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.