forked from exercism/java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAcronymTest.java
More file actions
82 lines (68 loc) · 2.25 KB
/
AcronymTest.java
File metadata and controls
82 lines (68 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.DisplayName;
import static org.assertj.core.api.Assertions.assertThat;
public class AcronymTest {
@DisplayName("basic")
@Test
public void basic() {
assertThat(new Acronym("Portable Network Graphics").get())
.isEqualTo("PNG");
}
@DisplayName("lowercase words")
@Disabled("Remove to run test")
@Test
public void lowercaseWords() {
assertThat(new Acronym("Ruby on Rails").get())
.isEqualTo("ROR");
}
@DisplayName("punctuation")
@Disabled("Remove to run test")
@Test
public void punctuation() {
assertThat(new Acronym("First In, First Out").get())
.isEqualTo("FIFO");
}
@DisplayName("all caps word")
@Disabled("Remove to run test")
@Test
public void nonAcronymAllCapsWord() {
assertThat(new Acronym("GNU Image Manipulation Program").get())
.isEqualTo("GIMP");
}
@DisplayName("punctuation without whitespace")
@Disabled("Remove to run test")
@Test
public void punctuationWithoutWhitespace() {
assertThat(new Acronym("Complementary metal-oxide semiconductor").get())
.isEqualTo("CMOS");
}
@DisplayName("very long abbreviation")
@Disabled("Remove to run test")
@Test
public void veryLongAbbreviation() {
assertThat(new Acronym("Rolling On The Floor Laughing So Hard That My Dogs Came Over And Licked Me").get())
.isEqualTo("ROTFLSHTMDCOALM");
}
@DisplayName("consecutive delimiters")
@Disabled("Remove to run test")
@Test
public void consecutiveDelimiters() {
assertThat(new Acronym("Something - I made up from thin air").get())
.isEqualTo("SIMUFTA");
}
@DisplayName("apostrophes")
@Disabled("Remove to run test")
@Test
public void apostrophes() {
assertThat(new Acronym("Halley's Comet").get())
.isEqualTo("HC");
}
@DisplayName("underscore emphasis")
@Disabled("Remove to run test")
@Test
public void underscoreEmphasis() {
assertThat(new Acronym("The Road _Not_ Taken").get())
.isEqualTo("TRNT");
}
}