|
|
@@ -1,5 +1,5 @@
|
|
1
|
|
-import org.junit.Test;
|
|
2
|
1
|
import org.junit.Ignore;
|
|
|
2
|
+import org.junit.Test;
|
|
3
|
3
|
import org.junit.experimental.runners.Enclosed;
|
|
4
|
4
|
import org.junit.runner.RunWith;
|
|
5
|
5
|
import org.junit.runners.Parameterized;
|
|
|
@@ -20,14 +20,14 @@ public class AtbashTest {
|
|
20
|
20
|
|
|
21
|
21
|
@Parameters(name = "{index}: expected plaintext \"{0}\" to encode to ciphertext \"{1}\".")
|
|
22
|
22
|
public static Collection<Object[]> data() {
|
|
23
|
|
- return Arrays.asList(new Object[][] {
|
|
24
|
|
- { "no", "ml" },
|
|
25
|
|
- { "yes", "bvh" },
|
|
26
|
|
- { "OMG", "lnt" },
|
|
27
|
|
- { "mindblowingly", "nrmwy oldrm tob" },
|
|
28
|
|
- { "Testing, 1 2 3, testing.", "gvhgr mt123 gvhgr mt" },
|
|
29
|
|
- { "Truth is fiction.", "gifgs rhurx grlm" },
|
|
30
|
|
- { "The quick brown fox jumps over the lazy dog.", "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt" }
|
|
|
23
|
+ return Arrays.asList(new Object[][]{
|
|
|
24
|
+ {"no", "ml"},
|
|
|
25
|
+ {"yes", "bvh"},
|
|
|
26
|
+ {"OMG", "lnt"},
|
|
|
27
|
+ {"mindblowingly", "nrmwy oldrm tob"},
|
|
|
28
|
+ {"Testing, 1 2 3, testing.", "gvhgr mt123 gvhgr mt"},
|
|
|
29
|
+ {"Truth is fiction.", "gifgs rhurx grlm"},
|
|
|
30
|
+ {"The quick brown fox jumps over the lazy dog.", "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt"}
|
|
31
|
31
|
});
|
|
32
|
32
|
}
|
|
33
|
33
|
|
|
|
@@ -37,9 +37,9 @@ public class AtbashTest {
|
|
37
|
37
|
}
|
|
38
|
38
|
|
|
39
|
39
|
|
|
40
|
|
- @Test
|
|
|
40
|
+ @Test
|
|
41
|
41
|
public void test() {
|
|
42
|
|
- assertEquals(ciphertext, Atbash.encode(plaintext));
|
|
|
42
|
+ assertEquals(ciphertext, new Atbash().encode(plaintext));
|
|
43
|
43
|
}
|
|
44
|
44
|
}
|
|
45
|
45
|
|
|
|
@@ -50,11 +50,11 @@ public class AtbashTest {
|
|
50
|
50
|
|
|
51
|
51
|
@Parameters(name = "{index}: expected ciphertext \"{0}\" to decode to plaintext \"{1}\".")
|
|
52
|
52
|
public static Collection<Object[]> data() {
|
|
53
|
|
- return Arrays.asList(new Object[][] {
|
|
54
|
|
- { "vcvix rhn", "exercism" },
|
|
55
|
|
- { "zmlyh gzxov rhlug vmzhg vkkrm thglm v", "anobstacleisoftenasteppingstone" },
|
|
56
|
|
- { "gvhgr mt123 gvhgr mt", "testing123testing" },
|
|
57
|
|
- { "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt", "thequickbrownfoxjumpsoverthelazydog" }
|
|
|
53
|
+ return Arrays.asList(new Object[][]{
|
|
|
54
|
+ {"vcvix rhn", "exercism"},
|
|
|
55
|
+ {"zmlyh gzxov rhlug vmzhg vkkrm thglm v", "anobstacleisoftenasteppingstone"},
|
|
|
56
|
+ {"gvhgr mt123 gvhgr mt", "testing123testing"},
|
|
|
57
|
+ {"gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt", "thequickbrownfoxjumpsoverthelazydog"}
|
|
58
|
58
|
});
|
|
59
|
59
|
}
|
|
60
|
60
|
|
|
|
@@ -64,9 +64,9 @@ public class AtbashTest {
|
|
64
|
64
|
}
|
|
65
|
65
|
|
|
66
|
66
|
@Ignore
|
|
67
|
|
- @Test
|
|
|
67
|
+ @Test
|
|
68
|
68
|
public void test() {
|
|
69
|
|
- assertEquals(plaintext, Atbash.decode(ciphertext));
|
|
|
69
|
+ assertEquals(plaintext, new Atbash().decode(ciphertext));
|
|
70
|
70
|
}
|
|
71
|
71
|
}
|
|
72
|
72
|
}
|