|
6 | 6 | ],
|
7 | 7 | "cases": [
|
8 | 8 | {
|
9 |
| - "uuid": "6d0a30e4-1b4e-472e-8e20-c41702125667", |
10 |
| - "description": "Adding a student adds them to the sorted roster", |
| 9 | + "uuid": "a3f0fb58-f240-4723-8ddc-e644666b85cc", |
| 10 | + "description": "Roster is empty when no student is added", |
11 | 11 | "property": "roster",
|
| 12 | + "input": { |
| 13 | + "students": [] |
| 14 | + }, |
| 15 | + "expected": [] |
| 16 | + }, |
| 17 | + { |
| 18 | + "uuid": "9337267f-7793-4b90-9b4a-8e3978408824", |
| 19 | + "description": "Add a student", |
| 20 | + "property": "add", |
12 | 21 | "input": {
|
13 | 22 | "students": [["Aimee", 2]]
|
14 | 23 | },
|
15 |
| - "expected": ["Aimee"] |
| 24 | + "expected": [true] |
16 | 25 | },
|
17 | 26 | {
|
18 |
| - "uuid": "c125dab7-2a53-492f-a99a-56ad511940d8", |
19 |
| - "description": "A student can't be in two different grades", |
20 |
| - "property": "roster", |
21 |
| - "input": { |
22 |
| - "students": [ |
23 |
| - ["Aimee", 2], |
24 |
| - ["Aimee", 1] |
25 |
| - ], |
26 |
| - "desiredGrade": 2 |
27 |
| - }, |
28 |
| - "expected": [] |
| 27 | + "uuid": "6d0a30e4-1b4e-472e-8e20-c41702125667", |
| 28 | + "description": "Student is added to the roster", |
| 29 | + "property": "roster", |
| 30 | + "input": { |
| 31 | + "students": [["Aimee", 2]] |
| 32 | + }, |
| 33 | + "expected": ["Aimee"] |
29 | 34 | },
|
30 | 35 | {
|
31 |
| - "uuid": "a0c7b9b8-0e89-47f8-8b4a-c50f885e79d1", |
32 |
| - "reimplements": "c125dab7-2a53-492f-a99a-56ad511940d8", |
33 |
| - "comments": [ |
34 |
| - "Reimplemented to be logically consistent" |
35 |
| - ], |
36 |
| - "description": "A student can only be added to the same grade in the roster once", |
37 |
| - "property": "roster", |
38 |
| - "input": { |
39 |
| - "students": [["Aimee", 2], ["Aimee", 2]] |
40 |
| - }, |
41 |
| - "expected": ["Aimee"] |
| 36 | + "uuid": "73c3ca75-0c16-40d7-82f5-ed8fe17a8e4a", |
| 37 | + "description": "Adding multiple students in the same grade in the roster", |
| 38 | + "property": "add", |
| 39 | + "input": { |
| 40 | + "students": [["Blair", 2], ["James", 2], ["Paul", 2]] |
| 41 | + }, |
| 42 | + "expected": [true, true, true] |
42 | 43 | },
|
43 | 44 | {
|
44 | 45 | "uuid": "233be705-dd58-4968-889d-fb3c7954c9cc",
|
45 |
| - "description": "Adding more students adds them to the sorted roster", |
| 46 | + "description": "Multiple students in the same grade are added to the roster", |
46 | 47 | "property": "roster",
|
47 | 48 | "input": {
|
48 | 49 | "students": [["Blair", 2], ["James", 2], ["Paul", 2]]
|
49 | 50 | },
|
50 | 51 | "expected": ["Blair", "James", "Paul"]
|
51 | 52 | },
|
| 53 | + { |
| 54 | + "uuid": "87c871c1-6bde-4413-9c44-73d59a259d83", |
| 55 | + "description": "Cannot add student to same grade in the roster more than once", |
| 56 | + "property": "add", |
| 57 | + "input": { |
| 58 | + "students": [["Blair", 2], ["James", 2], ["James", 2], ["Paul", 2]] |
| 59 | + }, |
| 60 | + "expected": [true, true, false, true] |
| 61 | + }, |
| 62 | + { |
| 63 | + "uuid": "c125dab7-2a53-492f-a99a-56ad511940d8", |
| 64 | + "description": "A student can't be in two different grades", |
| 65 | + "property": "roster", |
| 66 | + "input": { |
| 67 | + "students": [ |
| 68 | + ["Aimee", 2], |
| 69 | + ["Aimee", 1] |
| 70 | + ], |
| 71 | + "desiredGrade": 2 |
| 72 | + }, |
| 73 | + "expected": [] |
| 74 | + }, |
| 75 | + { |
| 76 | + "uuid": "a0c7b9b8-0e89-47f8-8b4a-c50f885e79d1", |
| 77 | + "reimplements": "c125dab7-2a53-492f-a99a-56ad511940d8", |
| 78 | + "comments": [ |
| 79 | + "Reimplemented to be logically consistent" |
| 80 | + ], |
| 81 | + "description": "A student can only be added to the same grade in the roster once", |
| 82 | + "property": "roster", |
| 83 | + "input": { |
| 84 | + "students": [["Aimee", 2], ["Aimee", 2]] |
| 85 | + }, |
| 86 | + "expected": ["Aimee"] |
| 87 | + }, |
| 88 | + { |
| 89 | + "uuid": "d7982c4f-1602-49f6-a651-620f2614243a", |
| 90 | + "description": "Student not added to same grade in the roster more than once", |
| 91 | + "reimplements": "a0c7b9b8-0e89-47f8-8b4a-c50f885e79d1", |
| 92 | + "comments": [ |
| 93 | + "Ensure the implementation does not affect students already added", |
| 94 | + "Ensure the implementation does not prevent addition of other students after preventing the error case" |
| 95 | + ], |
| 96 | + "property": "roster", |
| 97 | + "input": { |
| 98 | + "students": [["Blair", 2], ["James", 2], ["James", 2], ["Paul", 2]] |
| 99 | + }, |
| 100 | + "expected": ["Blair", "James", "Paul"] |
| 101 | + }, |
| 102 | + { |
| 103 | + "uuid": "e70d5d8f-43a9-41fd-94a4-1ea0fa338056", |
| 104 | + "description": "Adding students in multiple grades", |
| 105 | + "property": "add", |
| 106 | + "input": { |
| 107 | + "students": [["Chelsea", 3], ["Logan", 7]] |
| 108 | + }, |
| 109 | + "expected": [true, true] |
| 110 | + }, |
52 | 111 | {
|
53 | 112 | "uuid": "75a51579-d1d7-407c-a2f8-2166e984e8ab",
|
54 |
| - "description": "Adding students to different grades adds them to the same sorted roster", |
| 113 | + "description": "Students in multiple grades are added to the roster", |
55 | 114 | "property": "roster",
|
56 | 115 | "input": {
|
57 | 116 | "students": [["Chelsea", 3], ["Logan", 7]]
|
58 | 117 | },
|
59 | 118 | "expected": ["Chelsea", "Logan"]
|
60 | 119 | },
|
61 | 120 | {
|
62 |
| - "uuid": "6a03b61e-1211-4783-a3cc-fc7f773fba3f", |
63 |
| - "reimplements": "c125dab7-2a53-492f-a99a-56ad511940d8", |
64 |
| - "comments": [ |
65 |
| - "Reimplemented to be logically consistent" |
66 |
| - ], |
67 |
| - "description": "A student cannot be added to more than one grade in the sorted roster", |
68 |
| - "property": "roster", |
69 |
| - "input": { |
70 |
| - "students": [["Aimee", 2], ["Aimee", 1]] |
71 |
| - }, |
72 |
| - "expected": ["Aimee"] |
| 121 | + "uuid": "7df542f1-57ce-433c-b249-ff77028ec479", |
| 122 | + "description": "Cannot add same student to multiple grades in the roster", |
| 123 | + "property": "add", |
| 124 | + "input": { |
| 125 | + "students": [["Blair", 2], ["James", 2], ["James", 3], ["Paul", 3]] |
| 126 | + }, |
| 127 | + "expected": [true, true, false, true] |
73 | 128 | },
|
74 | 129 | {
|
75 |
| - "uuid": "a3f0fb58-f240-4723-8ddc-e644666b85cc", |
76 |
| - "description": "Roster returns an empty list if there are no students enrolled", |
| 130 | + "uuid": "6a03b61e-1211-4783-a3cc-fc7f773fba3f", |
| 131 | + "reimplements": "c125dab7-2a53-492f-a99a-56ad511940d8", |
| 132 | + "comments": [ |
| 133 | + "Reimplemented to be logically consistent" |
| 134 | + ], |
| 135 | + "description": "A student cannot be added to more than one grade in the sorted roster", |
77 | 136 | "property": "roster",
|
78 | 137 | "input": {
|
79 |
| - "students": [] |
| 138 | + "students": [["Aimee", 2], ["Aimee", 1]] |
80 | 139 | },
|
81 |
| - "expected": [] |
| 140 | + "expected": ["Aimee"] |
| 141 | + }, |
| 142 | + { |
| 143 | + "uuid": "c7ec1c5e-9ab7-4d3b-be5c-29f2f7a237c5", |
| 144 | + "reimplements": "6a03b61e-1211-4783-a3cc-fc7f773fba3f", |
| 145 | + "comments": [ |
| 146 | + "Ensure the implementation does not affect students already added", |
| 147 | + "Ensure the implementation does not prevent addition of other students after preventing the error case" |
| 148 | + ], |
| 149 | + "description": "Student not added to multiple grades in the roster", |
| 150 | + "property": "roster", |
| 151 | + "input": { |
| 152 | + "students": [["Blair", 2], ["James", 2], ["James", 3], ["Paul", 3]] |
| 153 | + }, |
| 154 | + "expected": ["Blair", "James", "Paul"] |
| 155 | + }, |
| 156 | + { |
| 157 | + "uuid": "d9af4f19-1ba1-48e7-94d0-dabda4e5aba6", |
| 158 | + "description": "Students are sorted by grades in the roster", |
| 159 | + "property": "roster", |
| 160 | + "input": { |
| 161 | + "students": [["Jim", 3], ["Peter", 2], ["Anna", 1]] |
| 162 | + }, |
| 163 | + "expected": ["Anna", "Peter", "Jim"] |
| 164 | + }, |
| 165 | + { |
| 166 | + "uuid": "d9fb5bea-f5aa-4524-9d61-c158d8906807", |
| 167 | + "description": "Students are sorted by name in the roster", |
| 168 | + "property": "roster", |
| 169 | + "input": { |
| 170 | + "students": [["Peter", 2], ["Zoe", 2], ["Alex", 2]] |
| 171 | + }, |
| 172 | + "expected": ["Alex", "Peter", "Zoe"] |
82 | 173 | },
|
83 | 174 | {
|
84 | 175 | "uuid": "180a8ff9-5b94-43fc-9db1-d46b4a8c93b6",
|
85 |
| - "description": "Student names with grades are displayed in the same sorted roster", |
| 176 | + "description": "Students are sorted by grades and then by name in the roster", |
86 | 177 | "property": "roster",
|
87 | 178 | "input": {
|
88 | 179 | "students": [["Peter", 2], ["Anna", 1], ["Barb", 1], ["Zoe", 2], ["Alex", 2], ["Jim", 3], ["Charlie", 1]]
|
89 | 180 | },
|
90 | 181 | "expected": ["Anna", "Barb", "Charlie", "Alex", "Peter", "Zoe", "Jim"]
|
91 | 182 | },
|
92 | 183 | {
|
93 |
| - "uuid": "1bfbcef1-e4a3-49e8-8d22-f6f9f386187e", |
94 |
| - "description": "Grade returns the students in that grade in alphabetical order", |
| 184 | + "uuid": "5e67aa3c-a3c6-4407-a183-d8fe59cd1630", |
| 185 | + "description": "Grade is empty if no students in the roster", |
95 | 186 | "property": "grade",
|
96 | 187 | "input": {
|
97 |
| - "students": [["Franklin", 5], ["Bradley", 5], ["Jeff", 1]], |
98 |
| - "desiredGrade": 5 |
| 188 | + "students": [], |
| 189 | + "desiredGrade": 1 |
99 | 190 | },
|
100 |
| - "expected": ["Bradley", "Franklin"] |
| 191 | + "expected": [] |
101 | 192 | },
|
102 | 193 | {
|
103 |
| - "uuid": "5e67aa3c-a3c6-4407-a183-d8fe59cd1630", |
104 |
| - "description": "Grade returns an empty list if there are no students in that grade", |
| 194 | + "uuid": "1e0cf06b-26e0-4526-af2d-a2e2df6a51d6", |
| 195 | + "description": "Grade is empty if no students in that grade", |
105 | 196 | "property": "grade",
|
106 | 197 | "input": {
|
107 |
| - "students": [], |
| 198 | + "students": [["Peter", 2], ["Zoe", 2], ["Alex", 2], ["Jim", 3]], |
108 | 199 | "desiredGrade": 1
|
109 | 200 | },
|
110 | 201 | "expected": []
|
| 202 | + }, |
| 203 | + { |
| 204 | + "uuid": "2bfc697c-adf2-4b65-8d0f-c46e085f796e", |
| 205 | + "description": "Student not added to same grade more than once", |
| 206 | + "property": "grade", |
| 207 | + "input": { |
| 208 | + "students": [["Blair", 2], ["James", 2], ["James", 2], ["Paul", 2]], |
| 209 | + "desiredGrade": 2 |
| 210 | + }, |
| 211 | + "expected": ["Blair", "James", "Paul"] |
| 212 | + }, |
| 213 | + { |
| 214 | + "uuid": "66c8e141-68ab-4a04-a15a-c28bc07fe6b9", |
| 215 | + "description": "Student not added to multiple grades", |
| 216 | + "property": "grade", |
| 217 | + "input": { |
| 218 | + "students": [["Blair", 2], ["James", 2], ["James", 3], ["Paul", 3]], |
| 219 | + "desiredGrade": 2 |
| 220 | + }, |
| 221 | + "expected": ["Blair", "James"] |
| 222 | + }, |
| 223 | + { |
| 224 | + "uuid": "c9c1fc2f-42e0-4d2c-b361-99271f03eda7", |
| 225 | + "description": "Student not added to other grade for multiple grades", |
| 226 | + "property": "grade", |
| 227 | + "input": { |
| 228 | + "students": [["Blair", 2], ["James", 2], ["James", 3], ["Paul", 3]], |
| 229 | + "desiredGrade": 3 |
| 230 | + }, |
| 231 | + "expected": ["Paul"] |
| 232 | + }, |
| 233 | + { |
| 234 | + "uuid": "1bfbcef1-e4a3-49e8-8d22-f6f9f386187e", |
| 235 | + "description": "Students are sorted by name in a grade", |
| 236 | + "property": "grade", |
| 237 | + "input": { |
| 238 | + "students": [["Franklin", 5], ["Bradley", 5], ["Jeff", 1]], |
| 239 | + "desiredGrade": 5 |
| 240 | + }, |
| 241 | + "expected": ["Bradley", "Franklin"] |
111 | 242 | }
|
112 | 243 | ]
|
113 | 244 | }
|
0 commit comments