Skip to content

Commit 040f059

Browse files
committed
flower-field, food-chain, forth
1 parent ba64554 commit 040f059

File tree

3 files changed

+80
-0
lines changed

3 files changed

+80
-0
lines changed

exercises/practice/flower-field/src/test/java/FlowerFieldBoardTest.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import org.junit.jupiter.api.Disabled;
2+
import org.junit.jupiter.api.DisplayName;
23
import org.junit.jupiter.api.Test;
34

45
import java.util.Arrays;
@@ -10,6 +11,7 @@
1011
public class FlowerFieldBoardTest {
1112

1213
@Test
14+
@DisplayName("no rows")
1315
public void testInputBoardWithNoRowsAndNoColumns() {
1416
List<String> inputBoard = Collections.emptyList();
1517
List<String> expectedNumberedBoard = Collections.emptyList();
@@ -20,6 +22,7 @@ public void testInputBoardWithNoRowsAndNoColumns() {
2022

2123
@Disabled("Remove to run test")
2224
@Test
25+
@DisplayName("no columns")
2326
public void testInputBoardWithOneRowAndNoColumns() {
2427
List<String> inputBoard = Collections.singletonList("");
2528
List<String> expectedNumberedBoard = Collections.singletonList("");
@@ -30,6 +33,7 @@ public void testInputBoardWithOneRowAndNoColumns() {
3033

3134
@Disabled("Remove to run test")
3235
@Test
36+
@DisplayName("no flowers")
3337
public void testInputBoardWithNoFlowers() {
3438
List<String> inputBoard = Arrays.asList(
3539
" ",
@@ -50,6 +54,7 @@ public void testInputBoardWithNoFlowers() {
5054

5155
@Disabled("Remove to run test")
5256
@Test
57+
@DisplayName("garden full of flowers")
5358
public void testInputBoardWithOnlyFlowers() {
5459
List<String> inputBoard = Arrays.asList(
5560
"***",
@@ -70,6 +75,7 @@ public void testInputBoardWithOnlyFlowers() {
7075

7176
@Disabled("Remove to run test")
7277
@Test
78+
@DisplayName("flower surrounded by spaces")
7379
public void testInputBoardWithSingleFlowerAtCenter() {
7480
List<String> inputBoard = Arrays.asList(
7581
" ",
@@ -90,6 +96,7 @@ public void testInputBoardWithSingleFlowerAtCenter() {
9096

9197
@Disabled("Remove to run test")
9298
@Test
99+
@DisplayName("space surrounded by flowers")
93100
public void testInputBoardWithFlowersAroundPerimeter() {
94101
List<String> inputBoard = Arrays.asList(
95102
"***",
@@ -110,6 +117,7 @@ public void testInputBoardWithFlowersAroundPerimeter() {
110117

111118
@Disabled("Remove to run test")
112119
@Test
120+
@DisplayName("horizontal line")
113121
public void testInputBoardWithSingleRowAndTwoFlowers() {
114122
List<String> inputBoard = Collections.singletonList(
115123
" * * "
@@ -126,6 +134,7 @@ public void testInputBoardWithSingleRowAndTwoFlowers() {
126134

127135
@Disabled("Remove to run test")
128136
@Test
137+
@DisplayName("horizontal line, flowers at edges")
129138
public void testInputBoardWithSingleRowAndTwoFlowersAtEdges() {
130139
List<String> inputBoard = Collections.singletonList(
131140
"* *"
@@ -142,6 +151,7 @@ public void testInputBoardWithSingleRowAndTwoFlowersAtEdges() {
142151

143152
@Disabled("Remove to run test")
144153
@Test
154+
@DisplayName("vertical line")
145155
public void testInputBoardWithSingleColumnAndTwoFlowers() {
146156
List<String> inputBoard = Arrays.asList(
147157
" ",
@@ -166,6 +176,7 @@ public void testInputBoardWithSingleColumnAndTwoFlowers() {
166176

167177
@Disabled("Remove to run test")
168178
@Test
179+
@DisplayName("vertical line, flowers at edges")
169180
public void testInputBoardWithSingleColumnAndTwoFlowersAtEdges() {
170181
List<String> inputBoard = Arrays.asList(
171182
"*",
@@ -190,6 +201,7 @@ public void testInputBoardWithSingleColumnAndTwoFlowersAtEdges() {
190201

191202
@Disabled("Remove to run test")
192203
@Test
204+
@DisplayName("cross")
193205
public void testInputBoardWithFlowersInCross() {
194206
List<String> inputBoard = Arrays.asList(
195207
" * ",
@@ -214,6 +226,7 @@ public void testInputBoardWithFlowersInCross() {
214226

215227
@Disabled("Remove to run test")
216228
@Test
229+
@DisplayName("large garden")
217230
public void testLargeInputBoard() {
218231
List<String> inputBoard = Arrays.asList(
219232
" * * ",

exercises/practice/food-chain/src/test/java/FoodChainTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import org.junit.jupiter.api.BeforeEach;
22
import org.junit.jupiter.api.Disabled;
3+
import org.junit.jupiter.api.DisplayName;
34
import org.junit.jupiter.api.Test;
45

56
import static org.assertj.core.api.Assertions.assertThat;
@@ -13,6 +14,7 @@ public void setup() {
1314
}
1415

1516
@Test
17+
@DisplayName("fly")
1618
public void fly() {
1719
int verse = 1;
1820
String expected = "I know an old lady who swallowed a fly.\n" +
@@ -23,6 +25,7 @@ public void fly() {
2325

2426
@Test
2527
@Disabled("Remove to run test.")
28+
@DisplayName("spider")
2629
public void spider() {
2730
int verse = 2;
2831
String expected = "I know an old lady who swallowed a spider.\n" +
@@ -35,6 +38,7 @@ public void spider() {
3538

3639
@Test
3740
@Disabled("Remove to run test.")
41+
@DisplayName("bird")
3842
public void bird() {
3943
int verse = 3;
4044
String expected = "I know an old lady who swallowed a bird.\n" +
@@ -49,6 +53,7 @@ public void bird() {
4953

5054
@Test
5155
@Disabled("Remove to run test.")
56+
@DisplayName("cat")
5257
public void cat() {
5358
int verse = 4;
5459
String expected = "I know an old lady who swallowed a cat.\n" +
@@ -65,6 +70,7 @@ public void cat() {
6570

6671
@Test
6772
@Disabled("Remove to run test.")
73+
@DisplayName("dog")
6874
public void dog() {
6975
int verse = 5;
7076
String expected = "I know an old lady who swallowed a dog.\n" +
@@ -81,6 +87,7 @@ public void dog() {
8187

8288
@Test
8389
@Disabled("Remove to run test.")
90+
@DisplayName("goat")
8491
public void goat() {
8592
int verse = 6;
8693
String expected = "I know an old lady who swallowed a goat.\n" +
@@ -98,6 +105,7 @@ public void goat() {
98105

99106
@Test
100107
@Disabled("Remove to run test.")
108+
@DisplayName("cow")
101109
public void cow() {
102110
int verse = 7;
103111
String expected = "I know an old lady who swallowed a cow.\n" +
@@ -116,6 +124,7 @@ public void cow() {
116124

117125
@Test
118126
@Disabled("Remove to run test.")
127+
@DisplayName("horse")
119128
public void horse() {
120129
int verse = 8;
121130
String expected = "I know an old lady who swallowed a horse.\n" +
@@ -127,6 +136,7 @@ public void horse() {
127136

128137
@Test
129138
@Disabled("Remove to run test.")
139+
@DisplayName("multiple verses")
130140
public void multipleVerses() {
131141
int startVerse = 1;
132142
int endVerse = 3;
@@ -151,6 +161,7 @@ public void multipleVerses() {
151161

152162
@Test
153163
@Disabled("Remove to run test.")
164+
@DisplayName("full song")
154165
public void wholeSong() {
155166
int startVerse = 1;
156167
int endVerse = 8;

0 commit comments

Comments
 (0)