8 references to BinarySearch
Microsoft.CodeAnalysis (4)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
198
=> _list.
BinarySearch
(index, count, item, comparer);
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
104
=> ReadOnlyList.
BinarySearch
(index, count, item, comparer);
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (2)
379
=>
BinarySearch
(0, Count, item, null);
382
=>
BinarySearch
(0, Count, item, comparer);
Microsoft.CodeAnalysis.UnitTests (4)
Collections\List\SegmentedList.Generic.Tests.BinarySearch.cs (4)
69
Assert.Throws<ArgumentException>(null, () => list.
BinarySearch
(0, count + 1, element, GetIComparer())); //"Finding items longer than array should throw ArgumentException"
70
Assert.Throws<ArgumentOutOfRangeException>(() => list.
BinarySearch
(-1, count, element, GetIComparer())); //"ArgumentOutOfRangeException should be thrown on negative index."
71
Assert.Throws<ArgumentOutOfRangeException>(() => list.
BinarySearch
(0, -1, element, GetIComparer())); //"ArgumentOutOfRangeException should be thrown on negative count."
72
Assert.Throws<ArgumentException>(null, () => list.
BinarySearch
(count + 1, count, element, GetIComparer())); //"ArgumentException should be thrown on index greater than length of array."