1
1
import org .junit .jupiter .api .BeforeEach ;
2
2
import org .junit .jupiter .api .Disabled ;
3
+ import org .junit .jupiter .api .DisplayName ;
3
4
import org .junit .jupiter .api .Test ;
4
5
5
6
import static org .assertj .core .api .Assertions .assertThat ;
@@ -14,13 +15,15 @@ public void setUp() {
14
15
}
15
16
16
17
@ Test
18
+ @ DisplayName ("just the header if no input" )
17
19
public void justTheHeaderIfNoInput () {
18
20
assertThat (tournament .printTable ())
19
21
.isEqualTo ("Team | MP | W | D | L | P\n " );
20
22
}
21
23
22
24
@ Disabled ("Remove to run test" )
23
25
@ Test
26
+ @ DisplayName ("a win is three points, a loss is zero points" )
24
27
public void aWinIsThreePointsALossIsZeroPoints () {
25
28
tournament .applyResults ("Allegoric Alaskans;Blithering Badgers;win" );
26
29
assertThat (tournament .printTable ())
@@ -32,6 +35,7 @@ public void aWinIsThreePointsALossIsZeroPoints() {
32
35
33
36
@ Disabled ("Remove to run test" )
34
37
@ Test
38
+ @ DisplayName ("a win can also be expressed as a loss" )
35
39
public void aWinCanAlsoBeExpressedAsALoss () {
36
40
tournament .applyResults ("Blithering Badgers;Allegoric Alaskans;loss" );
37
41
assertThat (tournament .printTable ())
@@ -43,6 +47,7 @@ public void aWinCanAlsoBeExpressedAsALoss() {
43
47
44
48
@ Disabled ("Remove to run test" )
45
49
@ Test
50
+ @ DisplayName ("a different team can win" )
46
51
public void aDifferentTeamCanWin () {
47
52
tournament .applyResults ("Blithering Badgers;Allegoric Alaskans;win" );
48
53
assertThat (tournament .printTable ())
@@ -54,6 +59,7 @@ public void aDifferentTeamCanWin() {
54
59
55
60
@ Disabled ("Remove to run test" )
56
61
@ Test
62
+ @ DisplayName ("a draw is one point each" )
57
63
public void aDrawIsOnePointEach () {
58
64
tournament .applyResults ("Allegoric Alaskans;Blithering Badgers;draw" );
59
65
assertThat (tournament .printTable ())
@@ -65,6 +71,7 @@ public void aDrawIsOnePointEach() {
65
71
66
72
@ Disabled ("Remove to run test" )
67
73
@ Test
74
+ @ DisplayName ("There can be more than one match" )
68
75
public void thereCanBeMoreThanOneMatch () {
69
76
tournament .applyResults (
70
77
"Allegoric Alaskans;Blithering Badgers;win\n " +
@@ -78,6 +85,7 @@ public void thereCanBeMoreThanOneMatch() {
78
85
79
86
@ Disabled ("Remove to run test" )
80
87
@ Test
88
+ @ DisplayName ("There can be more than one winner" )
81
89
public void thereCanBeMoreThanOneWinner () {
82
90
tournament .applyResults (
83
91
"Allegoric Alaskans;Blithering Badgers;loss\n " +
@@ -91,6 +99,7 @@ public void thereCanBeMoreThanOneWinner() {
91
99
92
100
@ Disabled ("Remove to run test" )
93
101
@ Test
102
+ @ DisplayName ("There can be more than two teams" )
94
103
public void thereCanBeMoreThanTwoTeams () {
95
104
tournament .applyResults (
96
105
"Allegoric Alaskans;Blithering Badgers;win\n " +
@@ -106,6 +115,7 @@ public void thereCanBeMoreThanTwoTeams() {
106
115
107
116
@ Disabled ("Remove to run test" )
108
117
@ Test
118
+ @ DisplayName ("typical input" )
109
119
public void typicalInput () {
110
120
tournament .applyResults (
111
121
"Allegoric Alaskans;Blithering Badgers;win\n " +
@@ -125,6 +135,7 @@ public void typicalInput() {
125
135
126
136
@ Disabled ("Remove to run test" )
127
137
@ Test
138
+ @ DisplayName ("incomplete competition (not all pairs have played)" )
128
139
public void incompleteCompetition () {
129
140
tournament .applyResults (
130
141
"Allegoric Alaskans;Blithering Badgers;loss\n " +
@@ -142,6 +153,7 @@ public void incompleteCompetition() {
142
153
143
154
@ Disabled ("Remove to run test" )
144
155
@ Test
156
+ @ DisplayName ("ties broken alphabetically" )
145
157
public void tiesBrokenAlphabetically () {
146
158
tournament .applyResults (
147
159
"Courageous Californians;Devastating Donkeys;win\n " +
@@ -161,6 +173,7 @@ public void tiesBrokenAlphabetically() {
161
173
162
174
@ Disabled ("Remove to run test" )
163
175
@ Test
176
+ @ DisplayName ("ensure points sorted numerically" )
164
177
public void pointsSortedNumerically () {
165
178
tournament .applyResults (
166
179
"Devastating Donkeys;Blithering Badgers;win\n " +
0 commit comments