|
1 | | -package algorithms.insertionsort; |
| 1 | +package com.baeldung.algorithms.insertionsort; |
2 | 2 |
|
3 | 3 | import com.baeldung.algorithms.insertionsort.InsertionSort; |
4 | 4 | import org.junit.Test; |
|
8 | 8 | public class InsertionSortUnitTest { |
9 | 9 |
|
10 | 10 | @Test |
11 | | - public void givenUnsortedArray_whenInsertionSortImperatively_thenItIsSortedInAscendingOrder() { |
| 11 | + public void givenUnsortedArray_whenInsertionSortImperative_thenSortedAsc() { |
12 | 12 | int[] input = {6, 2, 3, 4, 5, 1}; |
13 | 13 | InsertionSort.insertionSortImperative(input); |
14 | 14 | int[] expected = {1, 2, 3, 4, 5, 6}; |
15 | 15 | assertArrayEquals("the two arrays are not equal", expected, input); |
16 | 16 | } |
17 | 17 |
|
18 | 18 | @Test |
19 | | - public void givenUnsortedArray_whenInsertionSortRecursively_thenItIsSortedInAscendingOrder() { |
20 | | - // int[] input = {6, 4, 5, 2, 3, 1}; |
21 | | - int[] input = {6, 4}; |
| 19 | + public void givenUnsortedArray_whenInsertionSortRecursive_thenSortedAsc() { |
| 20 | + int[] input = {6, 4, 5, 2, 3, 1}; |
22 | 21 | InsertionSort.insertionSortRecursive(input); |
23 | 22 | int[] expected = {1, 2, 3, 4, 5, 6}; |
24 | 23 | assertArrayEquals("the two arrays are not equal", expected, input); |
|
0 commit comments