Skip to content

Commit 5c65ced

Browse files
committed
acronym, affine-cipher, all-your-base, allergies
1 parent f2ca28b commit 5c65ced

File tree

4 files changed

+95
-95
lines changed

4 files changed

+95
-95
lines changed

exercises/practice/acronym/src/test/java/AcronymTest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,72 +7,72 @@
77
public class AcronymTest {
88

99

10-
@DisplayName("basic")
1110
@Test
11+
@DisplayName("basic")
1212
public void basic() {
1313
assertThat(new Acronym("Portable Network Graphics").get())
1414
.isEqualTo("PNG");
1515
}
1616

17-
@DisplayName("lowercase words")
1817
@Disabled("Remove to run test")
1918
@Test
19+
@DisplayName("lowercase words")
2020
public void lowercaseWords() {
2121
assertThat(new Acronym("Ruby on Rails").get())
2222
.isEqualTo("ROR");
2323
}
2424

25-
@DisplayName("punctuation")
2625
@Disabled("Remove to run test")
2726
@Test
27+
@DisplayName("punctuation")
2828
public void punctuation() {
2929
assertThat(new Acronym("First In, First Out").get())
3030
.isEqualTo("FIFO");
3131
}
3232

33-
@DisplayName("all caps word")
3433
@Disabled("Remove to run test")
3534
@Test
35+
@DisplayName("all caps word")
3636
public void nonAcronymAllCapsWord() {
3737
assertThat(new Acronym("GNU Image Manipulation Program").get())
3838
.isEqualTo("GIMP");
3939
}
4040

41-
@DisplayName("punctuation without whitespace")
4241
@Disabled("Remove to run test")
4342
@Test
43+
@DisplayName("punctuation without whitespace")
4444
public void punctuationWithoutWhitespace() {
4545
assertThat(new Acronym("Complementary metal-oxide semiconductor").get())
4646
.isEqualTo("CMOS");
4747
}
4848

49-
@DisplayName("very long abbreviation")
5049
@Disabled("Remove to run test")
5150
@Test
51+
@DisplayName("very long abbreviation")
5252
public void veryLongAbbreviation() {
5353
assertThat(new Acronym("Rolling On The Floor Laughing So Hard That My Dogs Came Over And Licked Me").get())
5454
.isEqualTo("ROTFLSHTMDCOALM");
5555
}
5656

57-
@DisplayName("consecutive delimiters")
5857
@Disabled("Remove to run test")
5958
@Test
59+
@DisplayName("consecutive delimiters")
6060
public void consecutiveDelimiters() {
6161
assertThat(new Acronym("Something - I made up from thin air").get())
6262
.isEqualTo("SIMUFTA");
6363
}
6464

65-
@DisplayName("apostrophes")
6665
@Disabled("Remove to run test")
6766
@Test
67+
@DisplayName("apostrophes")
6868
public void apostrophes() {
6969
assertThat(new Acronym("Halley's Comet").get())
7070
.isEqualTo("HC");
7171
}
7272

73-
@DisplayName("underscore emphasis")
7473
@Disabled("Remove to run test")
7574
@Test
75+
@DisplayName("underscore emphasis")
7676
public void underscoreEmphasis() {
7777
assertThat(new Acronym("The Road _Not_ Taken").get())
7878
.isEqualTo("TRNT");

exercises/practice/affine-cipher/src/test/java/AffineCipherTest.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)