Created
July 24, 2014 20:29
-
-
Save sadv1r/cd5159c394d12ccece07 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ru.sadv1r.study.core.array; | |
import org.junit.*; | |
import java.util.Arrays; | |
import static org.junit.Assert.*; | |
/** | |
* Created by IntelliJ IDEA. | |
* User: Sadv1r | |
* Date: 7/24/14 | |
* Time: 10:35 | |
*/ | |
public class MergerTest { | |
@Test | |
public void merger() { | |
Merger merger = new Merger(); | |
int[][][] dataArrays = { | |
{{}, {}, {}}, | |
{{0}, {}, {0}}, | |
{{}, {0}, {0}}, | |
{{0}, {0}, {0, 0}}, | |
{{0, 2}, {1, 3}, {0, 1, 2, 3}}, | |
{{0, 2, 7, 9 ,123}, {1, 3, 4, 5, 6}, {0, 1, 2, 3, 4, 5, 6, 7, 9, 123}}, | |
{{0, 2, 7, 9, 9, 123}, {1, 3, 4, 5, 5, 6, 7, 9}, {0, 1, 2, 3, 4, 5, 5, 6, 7, 7, 9, 9, 9, 123}} | |
}; | |
for (int[][] arrays : dataArrays) { | |
int[] firstArray = arrays[0]; | |
int[] secondArray = arrays[1]; | |
int[] resultArray = arrays[2]; | |
int[] result = merger.merge(firstArray, secondArray); | |
assertArrayEquals(resultArray, result); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment