@@ -9,124 +9,124 @@ public class AffineCipherTest {
99
1010 private AffineCipher affineCipher = new AffineCipher ();
1111
12- @ DisplayName ("encode yes" )
1312 @ Test
13+ @ DisplayName ("encode yes" )
1414 public void testEncodeYes () {
1515 assertThat (affineCipher .encode ("yes" , 5 , 7 )).isEqualTo ("xbt" );
1616 }
1717
18- @ DisplayName ("encode no" )
1918 @ Disabled ("Remove to run test" )
2019 @ Test
20+ @ DisplayName ("encode no" )
2121 public void testEncodeNo () {
2222 assertThat (affineCipher .encode ("no" , 15 , 18 )).isEqualTo ("fu" );
2323 }
2424
25- @ DisplayName ("encode OMG" )
2625 @ Disabled ("Remove to run test" )
26+ @ DisplayName ("encode OMG" )
2727 @ Test
2828 public void testEncodeOMG () {
2929 assertThat (affineCipher .encode ("OMG" , 21 , 3 )).isEqualTo ("lvz" );
3030 }
3131
32- @ DisplayName ("encode O M G" )
3332 @ Disabled ("Remove to run test" )
3433 @ Test
34+ @ DisplayName ("encode O M G" )
3535 public void testEncodeO_M_G () {
3636 assertThat (affineCipher .encode ("O M G" , 25 , 47 )).isEqualTo ("hjp" );
3737 }
3838
39- @ DisplayName ("encode mindblowingly" )
4039 @ Disabled ("Remove to run test" )
4140 @ Test
41+ @ DisplayName ("encode mindblowingly" )
4242 public void testEncodeMindBlowingly () {
4343 assertThat (affineCipher .encode ("mindblowingly" , 11 , 15 )).isEqualTo ("rzcwa gnxzc dgt" );
4444 }
4545
46- @ DisplayName ("encode numbers" )
4746 @ Disabled ("Remove to run test" )
4847 @ Test
48+ @ DisplayName ("encode numbers" )
4949 public void testEncodeNumbers () {
5050 assertThat (affineCipher .encode ("Testing,1 2 3, testing." , 3 , 4 ))
5151 .isEqualTo ("jqgjc rw123 jqgjc rw" );
5252 }
5353
54- @ DisplayName ("encode deep thought" )
5554 @ Disabled ("Remove to run test" )
5655 @ Test
56+ @ DisplayName ("encode deep thought" )
5757 public void testEncodeDeepThought () {
5858 assertThat (affineCipher .encode ("Truth is fiction." , 5 , 17 ))
5959 .isEqualTo ("iynia fdqfb ifje" );
6060 }
6161
62- @ DisplayName ("encode all the letters" )
6362 @ Disabled ("Remove to run test" )
6463 @ Test
64+ @ DisplayName ("encode all the letters" )
6565 public void testEncodeAllTheLetters () {
6666 assertThat (affineCipher .encode ("The quick brown fox jumps over the lazy dog." , 17 , 33 ))
6767 .isEqualTo ("swxtj npvyk lruol iejdc blaxk swxmh qzglf" );
6868 }
6969
70- @ DisplayName ("encode with a not coprime to m" )
7170 @ Disabled ("Remove to run test" )
7271 @ Test
72+ @ DisplayName ("encode with a not coprime to m" )
7373 public void testEncodeThrowsMeaningfulException () {
7474 assertThatExceptionOfType (IllegalArgumentException .class )
7575 .isThrownBy (() -> affineCipher .encode ("This is a test" , 6 , 17 ))
7676 .withMessage ("Error: keyA and alphabet size must be coprime." );
7777 }
7878
79- @ DisplayName ("decode exercism" )
8079 @ Disabled ("Remove to run test" )
8180 @ Test
81+ @ DisplayName ("decode exercism" )
8282 public void testDecodeExercism () {
8383 assertThat (affineCipher .decode ("tytgn fjr" , 3 , 7 ))
8484 .isEqualTo ("exercism" );
8585 }
8686
87- @ DisplayName ("decode a sentence" )
8887 @ Disabled ("Remove to run test" )
8988 @ Test
89+ @ DisplayName ("decode a sentence" )
9090 public void testDecodeSentence () {
9191 assertThat (affineCipher .decode ("qdwju nqcro muwhn odqun oppmd aunwd o" , 19 , 16 ))
9292 .isEqualTo ("anobstacleisoftenasteppingstone" );
9393 }
9494
95- @ DisplayName ("decode numbers" )
9695 @ Disabled ("Remove to run test" )
9796 @ Test
97+ @ DisplayName ("decode numbers" )
9898 public void testDecodeNumbers () {
9999 assertThat (affineCipher .decode ("odpoz ub123 odpoz ub" , 25 , 7 ))
100100 .isEqualTo ("testing123testing" );
101101 }
102102
103- @ DisplayName ("decode all the letters" )
104103 @ Disabled ("Remove to run test" )
105104 @ Test
105+ @ DisplayName ("decode all the letters" )
106106 public void testDecodeAllTheLetters () {
107107 assertThat (affineCipher .decode ("swxtj npvyk lruol iejdc blaxk swxmh qzglf" , 17 , 33 ))
108108 .isEqualTo ("thequickbrownfoxjumpsoverthelazydog" );
109109 }
110110
111- @ DisplayName ("decode with no spaces in input" )
112111 @ Disabled ("Remove to run test" )
113112 @ Test
113+ @ DisplayName ("decode with no spaces in input" )
114114 public void testDecodeWithNoSpaces () {
115115 assertThat (affineCipher .decode ("swxtjnpvyklruoliejdcblaxkswxmhqzglf" , 17 , 33 ))
116116 .isEqualTo ("thequickbrownfoxjumpsoverthelazydog" );
117117 }
118118
119- @ DisplayName ("decode with too many spaces" )
120119 @ Disabled ("Remove to run test" )
121120 @ Test
121+ @ DisplayName ("decode with too many spaces" )
122122 public void testDecodeWithTooManySpaces () {
123123 assertThat (affineCipher .decode ("vszzm cly yd cg qdp" , 15 , 16 ))
124124 .isEqualTo ("jollygreengiant" );
125125 }
126126
127- @ DisplayName ("decode with a not coprime to m" )
128127 @ Disabled ("Remove to run test" )
129128 @ Test
129+ @ DisplayName ("decode with a not coprime to m" )
130130 public void testDecodeThrowsMeaningfulException () {
131131 assertThatExceptionOfType (IllegalArgumentException .class )
132132 .isThrownBy (() -> affineCipher .decode ("Test" , 13 , 5 ))
0 commit comments