Extend collection assertions with ContainInConsecutiveOrder and NotContainInConsecutiveOrder#1963
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
Co-authored-by: Jonas Nyrup <jnyrup@users.noreply.github.com>
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 <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>
Adds
ContainInConsecutiveOrderandNotContainInConsecutiveOrderto check that a collection is contained within another in order and with no gaps.This will close #1956
IMPORTANT