Пример #1
0
 @Test
 public void threeElementArrayWithDuplicatedValueLowerThanPivot() {
   assertThat(IntegerSort.sort(new int[] {4, 5, 4}), is(equalTo(new int[] {4, 4, 5})));
 }
Пример #2
0
 @Test
 public void sixElementArray() {
   assertThat(
       IntegerSort.sort(new int[] {4, 5, 4, 5, 5, 4}), is(equalTo(new int[] {4, 4, 4, 5, 5, 5})));
 }
Пример #3
0
 @Test
 public void fiveElementArrayFirstTwoNeedsSorting() {
   assertThat(IntegerSort.sort(new int[] {4, 3, 5, 6, 7}), is(equalTo(new int[] {3, 4, 5, 6, 7})));
 }
Пример #4
0
 @Test
 public void emptyArrayReturnsEmptyArray() {
   assertThat(IntegerSort.sort(new int[0]), is(equalTo(new int[0])));
 }
Пример #5
0
 @Test
 public void sevenElementArrayReturnsSorted() {
   assertThat(
       IntegerSort.sort(new int[] {9, 8, 7, 6, 5, 4, 3}),
       is(equalTo(new int[] {3, 4, 5, 6, 7, 8, 9})));
 }
Пример #6
0
 @Test
 public void threeElementArrayMovesLeftPointer() {
   assertThat(IntegerSort.sort(new int[] {4, 6, 5}), is(equalTo(new int[] {4, 5, 6})));
 }
Пример #7
0
 @Test
 public void fiveElementArrayReturnsSorted() {
   assertThat(IntegerSort.sort(new int[] {3, 6, 5, 4, 7}), is(equalTo(new int[] {3, 4, 5, 6, 7})));
 }
Пример #8
0
 @Test
 public void threeElementArrayReturnsSorted() {
   assertThat(IntegerSort.sort(new int[] {6, 5, 4}), is(equalTo(new int[] {4, 5, 6})));
 }
Пример #9
0
 @Test
 public void twoElementSortedArrayReturnsItself() {
   assertThat(IntegerSort.sort(new int[] {5, 6}), is(equalTo(new int[] {5, 6})));
 }
Пример #10
0
 @Test
 public void twoElementArrayIsReturnedSorted() {
   assertThat(IntegerSort.sort(new int[] {6, 5}), is(equalTo(new int[] {5, 6})));
 }
Пример #11
0
 @Test
 public void singleElementArrayReturnsItself() {
   assertThat(IntegerSort.sort(new int[] {5}), is(equalTo(new int[] {5})));
 }