Bladeren bron

Merge pull request #238 from FridaTveit/AtbashAddParameterAnnotationToDecodeTest

Added parameters test name annotation Atbash DecodeTest. 

Resolves #161.
John Ryan 9 jaren geleden
bovenliggende
commit
62962a452a
1 gewijzigde bestanden met toevoegingen van 7 en 7 verwijderingen
  1. 7
    7
      exercises/atbash-cipher/src/test/java/AtbashTest.java

+ 7
- 7
exercises/atbash-cipher/src/test/java/AtbashTest.java Bestand weergeven

45
 
45
 
46
     @RunWith(Parameterized.class)
46
     @RunWith(Parameterized.class)
47
     public static class DecodeTest {
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
         public static Collection<Object[]> data() {
52
         public static Collection<Object[]> data() {
53
             return Arrays.asList(new Object[][] {
53
             return Arrays.asList(new Object[][] {
54
                     { "vcvix rhn", "exercism" },
54
                     { "vcvix rhn", "exercism" },
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
         @Ignore
65
         @Ignore
66
     @Test
66
     @Test
67
         public void test() {
67
         public void test() {
68
-            assertEquals(expectedOutput, Atbash.decode(input));
68
+            assertEquals(plaintext, Atbash.decode(ciphertext));
69
         }
69
         }
70
     }
70
     }
71
 }
71
 }