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
37
38
|
import static org.junit.Assert.assertArrayEquals;
import org.junit.Test;
import org.junit.runners.JUnit4;
import java.util.Arrays;
public class SolutionTest {
@Test
public void basicTest1() {
String[] result = new String[] { "Hello", "hEllo", "heLlo", "helLo", "hellO" };
assertArrayEquals("it should return '" + Arrays.toString(result) + "'", result, MexicanWave.wave("hello"));
}
@Test
public void basicTest2() {
String[] result = new String[] { "Codewars", "cOdewars", "coDewars", "codEwars", "codeWars", "codewArs", "codewaRs", "codewarS" };
assertArrayEquals("it should return '" + Arrays.toString(result) + "'", result, MexicanWave.wave("codewars"));
}
@Test
public void basicTest3() {
String[] result = new String[] { };
assertArrayEquals("it should return '" + Arrays.toString(result) + "'", result, MexicanWave.wave(""));
}
@Test
public void basicTest4() {
String[] result = new String[] { "Two words", "tWo words", "twO words", "two Words", "two wOrds", "two woRds", "two worDs", "two wordS" };
assertArrayEquals("it should return '" + Arrays.toString(result) + "'", result, MexicanWave.wave("two words"));
}
@Test
public void basicTest5() {
String[] result = new String[] { " Gap ", " gAp ", " gaP " };
assertArrayEquals("it should return '" + Arrays.toString(result) + "'", result, MexicanWave.wave(" gap "));
}
}
|