fix unit test

This commit is contained in:
Loredana Crusoveanu 2018-10-09 13:10:13 +03:00
parent d385e7bbf5
commit ed2a28585c

View File

@ -1,4 +1,4 @@
package algorithms.insertionsort;
package com.baeldung.algorithms.insertionsort;
import com.baeldung.algorithms.insertionsort.InsertionSort;
import org.junit.Test;
@ -8,7 +8,7 @@ import static org.junit.Assert.assertArrayEquals;
public class InsertionSortUnitTest {
@Test
public void givenUnsortedArray_whenInsertionSortImperatively_thenItIsSortedInAscendingOrder() {
public void givenUnsortedArray_whenInsertionSortImperative_thenSortedAsc() {
int[] input = {6, 2, 3, 4, 5, 1};
InsertionSort.insertionSortImperative(input);
int[] expected = {1, 2, 3, 4, 5, 6};
@ -16,9 +16,8 @@ public class InsertionSortUnitTest {
}
@Test
public void givenUnsortedArray_whenInsertionSortRecursively_thenItIsSortedInAscendingOrder() {
// int[] input = {6, 4, 5, 2, 3, 1};
int[] input = {6, 4};
public void givenUnsortedArray_whenInsertionSortRecursive_thenSortedAsc() {
int[] input = {6, 4, 5, 2, 3, 1};
InsertionSort.insertionSortRecursive(input);
int[] expected = {1, 2, 3, 4, 5, 6};
assertArrayEquals("the two arrays are not equal", expected, input);