Browse Source

Added parameters test name annotation Atbash DecodeTest. Changed variable names to be more descriptive.

Frida Tveit 9 years ago
parent
commit
bd9ba2fcfd
1 changed files with 7 additions and 7 deletions
  1. 7
    7
      exercises/atbash-cipher/src/test/java/AtbashTest.java

+ 7
- 7
exercises/atbash-cipher/src/test/java/AtbashTest.java View File

@@ -45,10 +45,10 @@ public class AtbashTest {
45 45
 
46 46
     @RunWith(Parameterized.class)
47 47
     public static class DecodeTest {
48
-        private String input;
49
-        private String expectedOutput;
48
+        private String ciphertext;
49
+        private String plaintext;
50 50
 
51
-        @Parameters
51
+        @Parameters(name = "{index}: expected ciphertext \"{0}\" to decode to plaintext \"{1}\".")
52 52
         public static Collection<Object[]> data() {
53 53
             return Arrays.asList(new Object[][] {
54 54
                     { "vcvix rhn", "exercism" },
@@ -57,15 +57,15 @@ public class AtbashTest {
57 57
             });
58 58
         }
59 59
 
60
-        public DecodeTest(String input, String expectedOutput) {
61
-            this.input = input;
62
-            this.expectedOutput = expectedOutput;
60
+        public DecodeTest(String ciphertext, String plaintext) {
61
+            this.ciphertext = ciphertext;
62
+            this.plaintext = plaintext;
63 63
         }
64 64
 
65 65
         @Ignore
66 66
     @Test
67 67
         public void test() {
68
-            assertEquals(expectedOutput, Atbash.decode(input));
68
+            assertEquals(plaintext, Atbash.decode(ciphertext));
69 69
         }
70 70
     }
71 71
 }