- Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathInsertionSortTest.java
More file actions
Latest commit
26 lines (17 loc) · 696 Bytes
/
Copy pathInsertionSortTest.java
File metadata and controls
26 lines (17 loc) · 696 Bytes
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
packagesorting;
importstaticorg.junit.jupiter.api.Assertions.assertEquals;
importorg.junit.jupiter.api.DisplayName;
importorg.junit.jupiter.api.Test;
publicclassInsertionSortTest {
@Test
@DisplayName(" Insertion Sort")
publicvoidtestInsertionSort() {
InsertionSortinSort = newInsertionSort();
int[] actualArr = newint[] { 99, 85, 1, 25, 20, 7, 65, 11, 13, 14, 7, 0, 87 };
inSort.insertionSort(actualArr);
Stringactual = inSort.print(actualArr);
Stringexpected = "[ 0, 1, 7, 7, 11, 13, 14, 20, 25, 65, 85, 87, 99]";
assertEquals(expected, actual, "Insertion Sort should work");
System.out.println("Test - Insertion Sort: insertionSort() - passed ok");
}
}