initial commit

This commit is contained in:
Vaibhav Sahay 2018-09-29 15:24:09 +05:30 committed by GitHub
parent 191b27a8c5
commit 5db1d97f8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,26 @@
package com.baeldung.algorithms.mergesort;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
class MergeSortTest {
@Test
void positiveTest() {
int[] input = { 5, 1, 6, 2, 3, 4 };
int[] expected = { 1, 2, 3, 4, 5, 6 };
MergeSort.mergeSort(input, input.length);
assertArrayEquals(expected, input);
}
@Test
void negativeTest() {
int[] input = { 5, 1, 6, 2, 3, 4 };
int[] expected = { 1, 2, 3, 4, 6 ,5};
MergeSort.mergeSort(input, input.length);
assertArrayEquals(expected, input);
}
}