You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a new unit test for the SubArray array extension to ensure it works as expected when one index is out-of-bounds, e.g. -2 to n/2 (where n is the size of the array).
In this case the SubArray function should return the array of values from 0 to n/2.
Also update the test to take multiple parameters instead of having multiple assert statements in the same test. This will make it easier to add new test cases.
Value Proposition
The existing tests cases only cover cases with indices that are always in-bounds or out-of-bounds. Not a mix of the two. This test would help ensure the function behaves correctly in all cases.
Design Ideas
Refactor test case provider to provide the array, the start/end index, and the expected array
Add test cases for out-of-bound indices on one or both sides
The text was updated successfully, but these errors were encountered:
Requirement
Add a new unit test for the
SubArray
array extension to ensure it works as expected when one index is out-of-bounds, e.g.-2 to n/2
(wheren
is the size of the array).In this case the
SubArray
function should return the array of values from0 to n/2
.Also update the test to take multiple parameters instead of having multiple
assert
statements in the same test. This will make it easier to add new test cases.Value Proposition
The existing tests cases only cover cases with indices that are always in-bounds or out-of-bounds. Not a mix of the two. This test would help ensure the function behaves correctly in all cases.
Design Ideas
The text was updated successfully, but these errors were encountered: