Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add more bounds checks
Assert that ArgumentOutOfRangeException is thrown if specifying indexes for an empty array with PushRange(T[], int, int).
  • Loading branch information
martincostello committed Nov 29, 2021
commit f4e8a88b30ca5c6049b64fccff79ba720a3f49ff
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ public void PushRange_InvalidArguments_Throws()
var stack = new ConcurrentStack<int>();
Assert.Throws<ArgumentNullException>(() => stack.PushRange(null));
Assert.Throws<ArgumentNullException>(() => stack.PushRange(null, 0, 0));
Assert.Throws<ArgumentOutOfRangeException>(() => stack.PushRange(new int[0], 0, 0));
Assert.Throws<ArgumentOutOfRangeException>(() => stack.PushRange(new int[0], 0, 1));
Assert.Throws<ArgumentOutOfRangeException>(() => stack.PushRange(new int[1], 0, -1));
Assert.Throws<ArgumentOutOfRangeException>(() => stack.PushRange(new int[1], -1, 1));
Assert.Throws<ArgumentOutOfRangeException>(() => stack.PushRange(new int[1], 2, 1));
Expand Down