- Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMergeSortTest.java
More file actions
Latest commit
26 lines (17 loc) · 651 Bytes
/
Copy pathMergeSortTest.java
File metadata and controls
26 lines (17 loc) · 651 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;
publicclassMergeSortTest {
@Test
@DisplayName(" mergesort")
publicvoidtestMergeSort() {
MergeSortms = newMergeSort();
int[] actualArr = newint[] { 99, 85, 1, 25, 20, 7, 65, 11, 13, 14, 7, 0, 87 };
ms.mergeSort(actualArr);
Stringactual = ms.display(actualArr);
Stringexpected = "[ 0, 1, 7, 7, 11, 13, 14, 20, 25, 65, 85, 87, 99]";
assertEquals(expected, actual, "mergesorting should work");
System.out.println("Test - MergeSort: mergeSort() - passed ok");
}
}