forked from rampatra/Algorithms-and-Data-Structures-in-Java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestSelectionSort
36 lines (28 loc) · 914 Bytes
/
TestSelectionSort
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
class TestSort {
SelectionSort selectionSort = new SelectionSort();
@Test
public void tesInsertIntoSorted() {
int[] inputArr = new int[] {1,3,5};
int[] inputResult = new int[] {1,3,5};
selectionSort.selectionSort(inputArr);
assertArrayEquals(inputResult, inputArr);
}
SelectionSort selectionSort2 = new SelectionSort();
@Test
public void tesInsertIntoSorted2() {
int[] inputArr = new int[] {5,3,1};
int[] inputResult = new int[] {1,3,5};
selectionSort.selectionSort(inputArr);
assertArrayEquals(inputResult, inputArr);
}
SelectionSort selectionSort3 = new SelectionSort();
@Test
public void tesInsertIntoSorted3() {
int[] inputArr = new int[] {4,5,3,2};
int[] inputResult = new int[] {2,3,4,5};
selectionSort.selectionSort(inputArr);
assertArrayEquals(inputResult, inputArr);
}
}