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 ;
@@ -13,18 +14,21 @@ public void setUp() {
13
14
}
14
15
15
16
@ Test
17
+ @ DisplayName ("Roster is empty when no student is added" )
16
18
public void rosterReturnsAnEmptyListIfThereAreNoStudentsEnrolled () {
17
19
assertThat (school .roster ()).isEmpty ();
18
20
}
19
21
20
22
@ Disabled ("Remove to run test" )
21
23
@ Test
24
+ @ DisplayName ("Add a student" )
22
25
public void addAStudent () {
23
26
assertThat (school .add ("Aimee" , 2 )).isTrue ();
24
27
}
25
28
26
29
@ Disabled ("Remove to run test" )
27
30
@ Test
31
+ @ DisplayName ("Student is added to the roster" )
28
32
public void addingAStudentAddsThemToTheSortedRoster () {
29
33
school .add ("Aimee" , 2 );
30
34
@@ -33,6 +37,7 @@ public void addingAStudentAddsThemToTheSortedRoster() {
33
37
34
38
@ Disabled ("Remove to run test" )
35
39
@ Test
40
+ @ DisplayName ("Adding multiple students in the same grade in the roster" )
36
41
public void addingMultipleStudentsInTheSameGrade () {
37
42
assertThat (school .add ("Blair" , 2 )).isTrue ();
38
43
assertThat (school .add ("James" , 2 )).isTrue ();
@@ -41,6 +46,7 @@ public void addingMultipleStudentsInTheSameGrade() {
41
46
42
47
@ Disabled ("Remove to run test" )
43
48
@ Test
49
+ @ DisplayName ("Multiple students in the same grade are added to the roster" )
44
50
public void addingMoreStudentsAddsThemToTheSameSortedRoster () {
45
51
school .add ("Blair" , 2 );
46
52
school .add ("James" , 2 );
@@ -51,6 +57,7 @@ public void addingMoreStudentsAddsThemToTheSameSortedRoster() {
51
57
52
58
@ Disabled ("Remove to run test" )
53
59
@ Test
60
+ @ DisplayName ("Cannot add student to same grade in the roster more than once" )
54
61
public void cannotAddStudentsToSameGradeInTheRosterMoreThanOnce () {
55
62
assertThat (school .add ("Blair" , 2 )).isTrue ();
56
63
assertThat (school .add ("James" , 2 )).isTrue ();
@@ -60,6 +67,7 @@ public void cannotAddStudentsToSameGradeInTheRosterMoreThanOnce() {
60
67
61
68
@ Disabled ("Remove to run test" )
62
69
@ Test
70
+ @ DisplayName ("Student not added to same grade in the roster more than once" )
63
71
public void studentNotAddedToSameGradeInTheRosterMoreThanOnce () {
64
72
school .add ("Blair" , 2 );
65
73
school .add ("James" , 2 );
@@ -71,13 +79,15 @@ public void studentNotAddedToSameGradeInTheRosterMoreThanOnce() {
71
79
72
80
@ Disabled ("Remove to run test" )
73
81
@ Test
82
+ @ DisplayName ("Adding students in multiple grades" )
74
83
public void addingStudentsInMultipleGrades () {
75
84
assertThat (school .add ("Chelsea" , 3 )).isTrue ();
76
85
assertThat (school .add ("Logan" , 7 )).isTrue ();
77
86
}
78
87
79
88
@ Disabled ("Remove to run test" )
80
89
@ Test
90
+ @ DisplayName ("Students in multiple grades are added to the roster" )
81
91
public void addingStudentsToDifferentGradesAddsThemToTheSameSortedRoster () {
82
92
school .add ("Chelsea" , 3 );
83
93
school .add ("Logan" , 7 );
@@ -87,6 +97,7 @@ public void addingStudentsToDifferentGradesAddsThemToTheSameSortedRoster() {
87
97
88
98
@ Disabled ("Remove to run test" )
89
99
@ Test
100
+ @ DisplayName ("Cannot add same student to multiple grades in the roster" )
90
101
public void cannotAddSameStudentToMultipleGradesInTheRoster () {
91
102
assertThat (school .add ("Blair" , 2 )).isTrue ();
92
103
assertThat (school .add ("James" , 2 )).isTrue ();
@@ -96,6 +107,7 @@ public void cannotAddSameStudentToMultipleGradesInTheRoster() {
96
107
97
108
@ Disabled ("Remove to run test" )
98
109
@ Test
110
+ @ DisplayName ("Student not added to multiple grades in the roster" )
99
111
public void studentNotAddedToMultipleGradesInTheRoster () {
100
112
school .add ("Blair" , 2 );
101
113
school .add ("James" , 2 );
@@ -107,6 +119,7 @@ public void studentNotAddedToMultipleGradesInTheRoster() {
107
119
108
120
@ Disabled ("Remove to run test" )
109
121
@ Test
122
+ @ DisplayName ("Students are sorted by grades in the roster" )
110
123
public void studentsAreSortedByGradeInTheRoster () {
111
124
school .add ("Jim" , 3 );
112
125
school .add ("Peter" , 2 );
@@ -117,6 +130,7 @@ public void studentsAreSortedByGradeInTheRoster() {
117
130
118
131
@ Disabled ("Remove to run test" )
119
132
@ Test
133
+ @ DisplayName ("Students are sorted by name in the roster" )
120
134
public void studentsAreSortedByNameInTheRoster () {
121
135
school .add ("Peter" , 2 );
122
136
school .add ("Zoe" , 2 );
@@ -127,6 +141,7 @@ public void studentsAreSortedByNameInTheRoster() {
127
141
128
142
@ Disabled ("Remove to run test" )
129
143
@ Test
144
+ @ DisplayName ("Students are sorted by grades and then by name in the roster" )
130
145
public void studentsAreSortedByGradeAndThenByNameInTheRoster () {
131
146
school .add ("Peter" , 2 );
132
147
school .add ("Anna" , 1 );
@@ -141,12 +156,14 @@ public void studentsAreSortedByGradeAndThenByNameInTheRoster() {
141
156
142
157
@ Disabled ("Remove to run test" )
143
158
@ Test
159
+ @ DisplayName ("Grade is empty if no students in the roster" )
144
160
public void gradeIsEmptyIfNoStudentsInTheRoster () {
145
161
assertThat (school .grade (1 )).isEmpty ();
146
162
}
147
163
148
164
@ Disabled ("Remove to run test" )
149
165
@ Test
166
+ @ DisplayName ("Grade is empty if no students in that grade" )
150
167
public void gradeIsEmptyIfNoStudentsInThatGrade () {
151
168
school .add ("Peter" , 2 );
152
169
school .add ("Zoe" , 2 );
@@ -158,6 +175,7 @@ public void gradeIsEmptyIfNoStudentsInThatGrade() {
158
175
159
176
@ Disabled ("Remove to run test" )
160
177
@ Test
178
+ @ DisplayName ("Student not added to same grade more than once" )
161
179
public void studentNotAddedToTheSameGradeMoreThanOnce () {
162
180
school .add ("Blair" , 2 );
163
181
school .add ("James" , 2 );
@@ -169,6 +187,7 @@ public void studentNotAddedToTheSameGradeMoreThanOnce() {
169
187
170
188
@ Disabled ("Remove to run test" )
171
189
@ Test
190
+ @ DisplayName ("Student not added to multiple grades" )
172
191
public void studentNotAddedToMultipleGrades () {
173
192
school .add ("Blair" , 2 );
174
193
school .add ("James" , 2 );
@@ -181,6 +200,7 @@ public void studentNotAddedToMultipleGrades() {
181
200
182
201
@ Disabled ("Remove to run test" )
183
202
@ Test
203
+ @ DisplayName ("Students are sorted by name in a grade" )
184
204
public void studentsAreSortedByNameInAGrade () {
185
205
school .add ("Franklin" , 5 );
186
206
school .add ("Bradley" , 5 );
0 commit comments