Skip to content

Conversation

@StacyCash
Copy link
Contributor

@StacyCash StacyCash commented Jul 26, 2022

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.
@jnyrup jnyrup changed the title Extend GenericCollectionAssertions for ContainsInConsecutiveOrder and NotContainsInConsecutiveOrder Extend GenericCollectionAssertions for ContainInConsecutiveOrder and NotContainInConsecutiveOrder Jul 26, 2022
@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
Copy link

coveralls commented Jul 27, 2022

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

Copy link
Member

@jnyrup jnyrup left a comment

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.

Copy link
Member

@dennisdoomen dennisdoomen 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 the contribution.

@StacyCash
Copy link
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
Copy link
Member

jnyrup commented Jul 28, 2022

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

Copy link
Member

@jnyrup jnyrup left a comment

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 🤦‍♂️

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