Skip to content

Commit 66f528b

Browse files
authored
Add display name (#3022)
[no important files changed]
1 parent 52453a9 commit 66f528b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

exercises/practice/tournament/src/test/java/TournamentTest.java

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

1617
@Test
18+
@DisplayName("just the header if no input")
1719
public void justTheHeaderIfNoInput() {
1820
assertThat(tournament.printTable())
1921
.isEqualTo("Team | MP | W | D | L | P\n");
2022
}
2123

2224
@Disabled("Remove to run test")
2325
@Test
26+
@DisplayName("a win is three points, a loss is zero points")
2427
public void aWinIsThreePointsALossIsZeroPoints() {
2528
tournament.applyResults("Allegoric Alaskans;Blithering Badgers;win");
2629
assertThat(tournament.printTable())
@@ -32,6 +35,7 @@ public void aWinIsThreePointsALossIsZeroPoints() {
3235

3336
@Disabled("Remove to run test")
3437
@Test
38+
@DisplayName("a win can also be expressed as a loss")
3539
public void aWinCanAlsoBeExpressedAsALoss() {
3640
tournament.applyResults("Blithering Badgers;Allegoric Alaskans;loss");
3741
assertThat(tournament.printTable())
@@ -43,6 +47,7 @@ public void aWinCanAlsoBeExpressedAsALoss() {
4347

4448
@Disabled("Remove to run test")
4549
@Test
50+
@DisplayName("a different team can win")
4651
public void aDifferentTeamCanWin() {
4752
tournament.applyResults("Blithering Badgers;Allegoric Alaskans;win");
4853
assertThat(tournament.printTable())
@@ -54,6 +59,7 @@ public void aDifferentTeamCanWin() {
5459

5560
@Disabled("Remove to run test")
5661
@Test
62+
@DisplayName("a draw is one point each")
5763
public void aDrawIsOnePointEach() {
5864
tournament.applyResults("Allegoric Alaskans;Blithering Badgers;draw");
5965
assertThat(tournament.printTable())
@@ -65,6 +71,7 @@ public void aDrawIsOnePointEach() {
6571

6672
@Disabled("Remove to run test")
6773
@Test
74+
@DisplayName("There can be more than one match")
6875
public void thereCanBeMoreThanOneMatch() {
6976
tournament.applyResults(
7077
"Allegoric Alaskans;Blithering Badgers;win\n" +
@@ -78,6 +85,7 @@ public void thereCanBeMoreThanOneMatch() {
7885

7986
@Disabled("Remove to run test")
8087
@Test
88+
@DisplayName("There can be more than one winner")
8189
public void thereCanBeMoreThanOneWinner() {
8290
tournament.applyResults(
8391
"Allegoric Alaskans;Blithering Badgers;loss\n" +
@@ -91,6 +99,7 @@ public void thereCanBeMoreThanOneWinner() {
9199

92100
@Disabled("Remove to run test")
93101
@Test
102+
@DisplayName("There can be more than two teams")
94103
public void thereCanBeMoreThanTwoTeams() {
95104
tournament.applyResults(
96105
"Allegoric Alaskans;Blithering Badgers;win\n" +
@@ -106,6 +115,7 @@ public void thereCanBeMoreThanTwoTeams() {
106115

107116
@Disabled("Remove to run test")
108117
@Test
118+
@DisplayName("typical input")
109119
public void typicalInput() {
110120
tournament.applyResults(
111121
"Allegoric Alaskans;Blithering Badgers;win\n" +
@@ -125,6 +135,7 @@ public void typicalInput() {
125135

126136
@Disabled("Remove to run test")
127137
@Test
138+
@DisplayName("incomplete competition (not all pairs have played)")
128139
public void incompleteCompetition() {
129140
tournament.applyResults(
130141
"Allegoric Alaskans;Blithering Badgers;loss\n" +
@@ -142,6 +153,7 @@ public void incompleteCompetition() {
142153

143154
@Disabled("Remove to run test")
144155
@Test
156+
@DisplayName("ties broken alphabetically")
145157
public void tiesBrokenAlphabetically() {
146158
tournament.applyResults(
147159
"Courageous Californians;Devastating Donkeys;win\n" +
@@ -161,6 +173,7 @@ public void tiesBrokenAlphabetically() {
161173

162174
@Disabled("Remove to run test")
163175
@Test
176+
@DisplayName("ensure points sorted numerically")
164177
public void pointsSortedNumerically() {
165178
tournament.applyResults(
166179
"Devastating Donkeys;Blithering Badgers;win\n" +

0 commit comments

Comments
 (0)