|
1 | 1 | import org.junit.jupiter.api.Disabled;
|
| 2 | +import org.junit.jupiter.api.DisplayName; |
2 | 3 | import org.junit.jupiter.api.Test;
|
3 | 4 |
|
4 | 5 | import static org.assertj.core.api.Assertions.assertThat;
|
5 | 6 |
|
6 | 7 | public class ScrabbleScoreTest {
|
7 | 8 |
|
8 | 9 | @Test
|
| 10 | + @DisplayName("lowercase letter") |
9 | 11 | public void testALowerCaseLetter() {
|
10 | 12 | Scrabble scrabble = new Scrabble("a");
|
11 | 13 | assertThat(scrabble.getScore()).isEqualTo(1);
|
12 | 14 | }
|
13 | 15 |
|
14 | 16 | @Disabled("Remove to run test")
|
15 | 17 | @Test
|
| 18 | + @DisplayName("uppercase letter") |
16 | 19 | public void testAUpperCaseLetter() {
|
17 | 20 | Scrabble scrabble = new Scrabble("A");
|
18 | 21 | assertThat(scrabble.getScore()).isEqualTo(1);
|
19 | 22 | }
|
20 | 23 |
|
21 | 24 | @Disabled("Remove to run test")
|
22 | 25 | @Test
|
| 26 | + @DisplayName("valuable letter") |
23 | 27 | public void testAValuableLetter() {
|
24 | 28 | Scrabble scrabble = new Scrabble("f");
|
25 | 29 | assertThat(scrabble.getScore()).isEqualTo(4);
|
26 | 30 | }
|
27 | 31 |
|
28 | 32 | @Disabled("Remove to run test")
|
29 | 33 | @Test
|
| 34 | + @DisplayName("short word") |
30 | 35 | public void testAShortWord() {
|
31 | 36 | Scrabble scrabble = new Scrabble("at");
|
32 | 37 | assertThat(scrabble.getScore()).isEqualTo(2);
|
33 | 38 | }
|
34 | 39 |
|
35 | 40 | @Disabled("Remove to run test")
|
36 | 41 | @Test
|
| 42 | + @DisplayName("short, valuable word") |
37 | 43 | public void testAShortValuableWord() {
|
38 | 44 | Scrabble scrabble = new Scrabble("zoo");
|
39 | 45 | assertThat(scrabble.getScore()).isEqualTo(12);
|
40 | 46 | }
|
41 | 47 |
|
42 | 48 | @Disabled("Remove to run test")
|
43 | 49 | @Test
|
| 50 | + @DisplayName("medium word") |
44 | 51 | public void testAMediumWord() {
|
45 | 52 | Scrabble scrabble = new Scrabble("street");
|
46 | 53 | assertThat(scrabble.getScore()).isEqualTo(6);
|
47 | 54 | }
|
48 | 55 |
|
49 | 56 | @Disabled("Remove to run test")
|
50 | 57 | @Test
|
| 58 | + @DisplayName("medium, valuable word") |
51 | 59 | public void testAMediumValuableWord() {
|
52 | 60 | Scrabble scrabble = new Scrabble("quirky");
|
53 | 61 | assertThat(scrabble.getScore()).isEqualTo(22);
|
54 | 62 | }
|
55 | 63 |
|
56 | 64 | @Disabled("Remove to run test")
|
57 | 65 | @Test
|
| 66 | + @DisplayName("long, mixed-case word") |
58 | 67 | public void testALongMixCaseWord() {
|
59 | 68 | Scrabble scrabble = new Scrabble("OxyphenButazone");
|
60 | 69 | assertThat(scrabble.getScore()).isEqualTo(41);
|
61 | 70 | }
|
62 | 71 |
|
63 | 72 | @Disabled("Remove to run test")
|
64 | 73 | @Test
|
| 74 | + @DisplayName("english-like word") |
65 | 75 | public void testAEnglishLikeWord() {
|
66 | 76 | Scrabble scrabble = new Scrabble("pinata");
|
67 | 77 | assertThat(scrabble.getScore()).isEqualTo(8);
|
68 | 78 | }
|
69 | 79 |
|
70 | 80 | @Disabled("Remove to run test")
|
71 | 81 | @Test
|
| 82 | + @DisplayName("empty input") |
72 | 83 | public void testAnEmptyInput() {
|
73 | 84 | Scrabble scrabble = new Scrabble("");
|
74 | 85 | assertThat(scrabble.getScore()).isEqualTo(0);
|
75 | 86 | }
|
76 | 87 |
|
77 | 88 | @Disabled("Remove to run test")
|
78 | 89 | @Test
|
| 90 | + @DisplayName("entire alphabet available") |
79 | 91 | public void testEntireAlphabetAvailable() {
|
80 | 92 | Scrabble scrabble = new Scrabble("abcdefghijklmnopqrstuvwxyz");
|
81 | 93 | assertThat(scrabble.getScore()).isEqualTo(87);
|
|
0 commit comments