-
Notifications
You must be signed in to change notification settings - Fork 733
Extend collection assertions with ContainInConsecutiveOrder and NotContainInConsecutiveOrder
#1963
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
Conversation
Two functions to check that a cleections contains or doesn't contain the items from a second collections consecutively.
Src/FluentAssertions/Collections/GenericCollectionAssertions.cs
Outdated
Show resolved
Hide resolved
ContainInConsecutiveOrder and NotContainInConsecutiveOrder
Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainInConsecutiveOrder.cs
Outdated
Show resolved
Hide resolved
ContainInConsecutiveOrder and NotContainInConsecutiveOrderContainInConsecutiveOrder and NotContainInConsecutiveOrder
Pull Request Test Coverage Report for Build 2754590099Warning: 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
💛 - Coveralls |
jnyrup
left a comment
There was a problem hiding this 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.
Src/FluentAssertions/Collections/GenericCollectionAssertions.cs
Outdated
Show resolved
Hide resolved
Src/FluentAssertions/Collections/GenericCollectionAssertions.cs
Outdated
Show resolved
Hide resolved
Src/FluentAssertions/Collections/GenericCollectionAssertions.cs
Outdated
Show resolved
Hide resolved
dennisdoomen
left a comment
There was a problem hiding this 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.
|
@jnyrup I've looked at your changes and rewritten both the |
|
Major improvement! I haven't looked deeply into the tests, but it seems we could use a test when calling with an empty |
|
There is an empty test for If you let me know the style issues I'll either look at them in the morning or when I return. |
jnyrup
left a comment
There was a problem hiding this 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 🤦♂️
Src/FluentAssertions/Collections/GenericCollectionAssertions.cs
Outdated
Show resolved
Hide resolved
Src/FluentAssertions/Collections/GenericCollectionAssertions.cs
Outdated
Show resolved
Hide resolved
Src/FluentAssertions/Collections/GenericCollectionAssertions.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Jonas Nyrup <[email protected]>
Co-authored-by: Jonas Nyrup <[email protected]>
Co-authored-by: Jonas Nyrup <[email protected]>
Adds
ContainInConsecutiveOrderandNotContainInConsecutiveOrderto check that a collection is contained within another in order and with no gaps.This will close #1956
IMPORTANT