Add UsingTestingSequence to enforce simpler & correct usage#475
Open
atifaziz wants to merge 14 commits intomorelinq:masterfrom
Open
Add UsingTestingSequence to enforce simpler & correct usage#475atifaziz wants to merge 14 commits intomorelinq:masterfrom
UsingTestingSequence to enforce simpler & correct usage#475atifaziz wants to merge 14 commits intomorelinq:masterfrom
Conversation
leandromoh
approved these changes
Apr 29, 2018
Collaborator
|
I think all the explanation and operator list should be in a issue. So we can create PR for each operator. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #475 +/- ##
=======================================
Coverage 92.39% 92.39%
=======================================
Files 112 112
Lines 3447 3447
Branches 1021 1021
=======================================
Hits 3185 3185
Misses 200 200
Partials 62 62 ☔ View full report in Codecov by Sentry. |
Conflicts resolved: - MoreLinq.Test/EndsWithTest.cs - MoreLinq.Test/RankTest.cs
UsingTestingSequence to enforce simpler & correct usage
leandromoh
approved these changes
Jan 15, 2023
42 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR obsoletes the use of
AsTestingSequencein favour of the newUsingTestingSequence. This is done to enforces simpler & more correct usage.TestingSequenceis primarily designed to help test two things in an operator:However, most uses seemed to be exercising the first but not the second. The latter was probably often skipped/missed because it required more non-obvious setup; an explicit
usingblock (non-obvious usage) as well as eager evaluation before assertion of results. Take the following example:This will only ensure that
Rankdoesn't iteratesequencemore than once when it's iterated during testing. To also test that it disposes the source iterator when done, the above has to be written as:With
UsingTestingSequence, you just do:TestingSequenceUses Needing ReviewCompareCountTestCountDownTestEndsWithTestEquiZipTestFlattenTestFoldTestInterleaveTestMoveTestNestedLoopTestRankTestSortedMergeTestStartsWithTestTakeLastTestTestingSequenceTransposeTestZipLongestTestZipShortestTest