Skip to content

Commit b9f23fa

Browse files
Add DisplayName annotations to rectangles
1 parent 112a13b commit b9f23fa

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

exercises/practice/rectangles/src/test/java/RectangleCounterTest.java

Lines changed: 15 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;
@@ -14,6 +15,7 @@ public void setUp() {
1415
}
1516

1617
@Test
18+
@DisplayName("no rows")
1719
public void testInputWithNoRowsContainsNoRectangles() {
1820
String[] inputGrid = new String[]{};
1921

@@ -22,6 +24,7 @@ public void testInputWithNoRowsContainsNoRectangles() {
2224

2325
@Disabled("Remove to run test")
2426
@Test
27+
@DisplayName("no columns")
2528
public void testInputWithNoColumnsContainsNoRectangles() {
2629
String[] inputGrid = new String[]{""};
2730

@@ -30,6 +33,7 @@ public void testInputWithNoColumnsContainsNoRectangles() {
3033

3134
@Disabled("Remove to run test")
3235
@Test
36+
@DisplayName("no rectangles")
3337
public void testNonTrivialInputWithNoRectangles() {
3438
String[] inputGrid = new String[]{" "};
3539

@@ -38,6 +42,7 @@ public void testNonTrivialInputWithNoRectangles() {
3842

3943
@Disabled("Remove to run test")
4044
@Test
45+
@DisplayName("one rectangle")
4146
public void testInputWithOneRectangle() {
4247
String[] inputGrid = new String[]{
4348
"+-+",
@@ -50,6 +55,7 @@ public void testInputWithOneRectangle() {
5055

5156
@Disabled("Remove to run test")
5257
@Test
58+
@DisplayName("two rectangles without shared parts")
5359
public void testInputWithTwoRectanglesWithoutSharedEdges() {
5460
String[] inputGrid = new String[]{
5561
" +-+",
@@ -64,6 +70,7 @@ public void testInputWithTwoRectanglesWithoutSharedEdges() {
6470

6571
@Disabled("Remove to run test")
6672
@Test
73+
@DisplayName("five rectangles with shared parts")
6774
public void testInputWithFiveRectanglesWithSharedEdges() {
6875
String[] inputGrid = new String[]{
6976
" +-+",
@@ -78,6 +85,7 @@ public void testInputWithFiveRectanglesWithSharedEdges() {
7885

7986
@Disabled("Remove to run test")
8087
@Test
88+
@DisplayName("rectangle of height 1 is counted")
8189
public void testThatRectangleOfHeightOneIsCounted() {
8290
String[] inputGrid = new String[]{
8391
"+--+",
@@ -89,6 +97,7 @@ public void testThatRectangleOfHeightOneIsCounted() {
8997

9098
@Disabled("Remove to run test")
9199
@Test
100+
@DisplayName("rectangle of width 1 is counted")
92101
public void testThatRectangleOfWidthOneIsCounted() {
93102
String[] inputGrid = new String[]{
94103
"++",
@@ -101,6 +110,7 @@ public void testThatRectangleOfWidthOneIsCounted() {
101110

102111
@Disabled("Remove to run test")
103112
@Test
113+
@DisplayName("1x1 square is counted")
104114
public void testThatOneByOneSquareIsCounted() {
105115
String[] inputGrid = new String[]{
106116
"++",
@@ -112,6 +122,7 @@ public void testThatOneByOneSquareIsCounted() {
112122

113123
@Disabled("Remove to run test")
114124
@Test
125+
@DisplayName("only complete rectangles are counted")
115126
public void testThatIncompleteRectanglesAreNotCounted() {
116127
String[] inputGrid = new String[]{
117128
" +-+",
@@ -126,6 +137,7 @@ public void testThatIncompleteRectanglesAreNotCounted() {
126137

127138
@Disabled("Remove to run test")
128139
@Test
140+
@DisplayName("rectangles can be of different sizes")
129141
public void testThatRectanglesOfDifferentSizesAreAllCounted() {
130142
String[] inputGrid = new String[]{
131143
"+------+----+",
@@ -140,6 +152,7 @@ public void testThatRectanglesOfDifferentSizesAreAllCounted() {
140152

141153
@Disabled("Remove to run test")
142154
@Test
155+
@DisplayName("corner is required for a rectangle to be complete")
143156
public void testThatIntersectionsWithoutCornerCharacterDoNotCountAsRectangleCorners() {
144157
String[] inputGrid = new String[]{
145158
"+------+----+",
@@ -154,6 +167,7 @@ public void testThatIntersectionsWithoutCornerCharacterDoNotCountAsRectangleCorn
154167

155168
@Disabled("Remove to run test")
156169
@Test
170+
@DisplayName("large input with many rectangles")
157171
public void testLargeInputWithManyRectangles() {
158172
String[] inputGrid = new String[]{
159173
"+---+--+----+",
@@ -171,6 +185,7 @@ public void testLargeInputWithManyRectangles() {
171185

172186
@Disabled("Remove to run test")
173187
@Test
188+
@DisplayName("rectangles must have four sides")
174189
public void testRectanglesMustHaveFourSides() {
175190
String[] inputGrid = new String[]{
176191
"+-+ +-+",

0 commit comments

Comments
 (0)