|
| 1 | +{ |
| 2 | + "exercise": "grade-school2", |
| 3 | + "comments": [ |
| 4 | + "Given students' names along with the grade that they are in, ", |
| 5 | + "create a roster for the school." |
| 6 | + ], |
| 7 | + "cases": [ |
| 8 | + { |
| 9 | + "uuid": "806b873f-13ca-4b19-9161-e3e11bdd15ef", |
| 10 | + "description": "Roster is empty when no student is added", |
| 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", |
| 21 | + "input": { |
| 22 | + "students": [["Aimee", 2]] |
| 23 | + }, |
| 24 | + "expected": true |
| 25 | + }, |
| 26 | + { |
| 27 | + "uuid": "aff83e6e-6bdc-4753-9f98-142d19e3f5c4", |
| 28 | + "description": "Student is added to the roster", |
| 29 | + "property": "roster", |
| 30 | + "input": { |
| 31 | + "students": [["Aimee", 2]] |
| 32 | + }, |
| 33 | + "expected": ["Aimee"] |
| 34 | + }, |
| 35 | + { |
| 36 | + "uuid": "73c3ca75-0c16-40d7-82f5-ed8fe17a8e4a", |
| 37 | + "description": "Adding multiple students in same the grade", |
| 38 | + "property": "add", |
| 39 | + "input": { |
| 40 | + "students": [["Blair", 2], ["James", 2], ["Paul", 2]] |
| 41 | + }, |
| 42 | + "expected": [true, true, true] |
| 43 | + }, |
| 44 | + { |
| 45 | + "uuid": "c398a433-7a4e-4d80-b379-938944c68a64", |
| 46 | + "description": "Multiple students in the same grade are added to the roster", |
| 47 | + "property": "roster", |
| 48 | + "input": { |
| 49 | + "students": [["Blair", 2], ["James", 2], ["Paul", 2]] |
| 50 | + }, |
| 51 | + "expected": ["Blair", "James", "Paul"] |
| 52 | + }, |
| 53 | + { |
| 54 | + "uuid": "87c871c1-6bde-4413-9c44-73d59a259d83", |
| 55 | + "description": "Cannot add student to same grade more than once", |
| 56 | + "property": "add", |
| 57 | + "input": { |
| 58 | + "students": [["Aimee", 2], ["Aimee", 2]] |
| 59 | + }, |
| 60 | + "expected": [true, false] |
| 61 | + }, |
| 62 | + { |
| 63 | + "uuid": "d7982c4f-1602-49f6-a651-620f2614243a", |
| 64 | + "description": "Student not added to same grade more than once", |
| 65 | + "property": "roster", |
| 66 | + "input": { |
| 67 | + "students": [["Aimee", 2], ["Aimee", 2]] |
| 68 | + }, |
| 69 | + "expected": ["Aimee"] |
| 70 | + }, |
| 71 | + { |
| 72 | + "uuid": "e70d5d8f-43a9-41fd-94a4-1ea0fa338056", |
| 73 | + "description": "Adding students in multiple grades", |
| 74 | + "property": "add", |
| 75 | + "input": { |
| 76 | + "students": [["Chelse", 3], ["Logan", 7]] |
| 77 | + }, |
| 78 | + "expected": [true, true] |
| 79 | + }, |
| 80 | + { |
| 81 | + "uuid": "d7fe849e-ce01-4612-8b61-05a633c34f26", |
| 82 | + "description": "Students in multiple grades are added to the roster", |
| 83 | + "property": "roster", |
| 84 | + "input": { |
| 85 | + "students": [["Chelse", 3], ["Logan", 7]] |
| 86 | + }, |
| 87 | + "expected": ["Chelsea", "Logan"] |
| 88 | + }, |
| 89 | + { |
| 90 | + "uuid": "7df542f1-57ce-433c-b249-ff77028ec479", |
| 91 | + "description": "Cannot add same student to multiple grades", |
| 92 | + "property": "add", |
| 93 | + "input": { |
| 94 | + "students": [["Aimee", 2], ["Aimee", 1]] |
| 95 | + }, |
| 96 | + "expected": [true, false] |
| 97 | + }, |
| 98 | + { |
| 99 | + "uuid": "c7ec1c5e-9ab7-4d3b-be5c-29f2f7a237c5", |
| 100 | + "description": "Student not added to multiple grades", |
| 101 | + "property": "roster", |
| 102 | + "input": { |
| 103 | + "students": [["Aimee", 2], ["Aimee", 1]] |
| 104 | + }, |
| 105 | + "expected": ["Aimee"] |
| 106 | + }, |
| 107 | + { |
| 108 | + "uuid": "d9af4f19-1ba1-48e7-94d0-dabda4e5aba6", |
| 109 | + "description": "Students are sorted by grades in the roster", |
| 110 | + "property": "roster", |
| 111 | + "input": { |
| 112 | + "students": [["Jim", 3], ["Peter", 2], ["Anna", 1]] |
| 113 | + }, |
| 114 | + "expected": ["Anna", "Peter", "Jim"] |
| 115 | + }, |
| 116 | + { |
| 117 | + "uuid": "d9fb5bea-f5aa-4524-9d61-c158d8906807", |
| 118 | + "description": "Students are sorted by name in the roster", |
| 119 | + "property": "roster", |
| 120 | + "input": { |
| 121 | + "students": [["Peter", 2], ["Zoe", 2], ["Alex", 2]] |
| 122 | + }, |
| 123 | + "expected": ["Alex", "Peter", "Zoe"] |
| 124 | + }, |
| 125 | + { |
| 126 | + "uuid": "4227a6ba-7734-4029-83bc-24b1e0bcad82", |
| 127 | + "description": "Students are sorted by grades and names in the roster", |
| 128 | + "property": "roster", |
| 129 | + "input": { |
| 130 | + "students": [["Peter", 2], ["Anna", 1], ["Barb", 1], ["Zoe", 2], ["Alex", 2], ["Jim", 3], ["Charlie", 1]] |
| 131 | + }, |
| 132 | + "expected": ["Anna", "Barb", "Charlie", "Alex", "Peter", "Zoe", "Jim"] |
| 133 | + }, |
| 134 | + { |
| 135 | + "uuid": "1e0cf06b-26e0-4526-af2d-a2e2df6a51d6", |
| 136 | + "description": "Grade is empty if no students in that grade", |
| 137 | + "property": "grade", |
| 138 | + "input": { |
| 139 | + "students": [["Peter", 2], ["Zoe", 2], ["Alex", 2], ["Jim", 3]], |
| 140 | + "desiredGrade": 1 |
| 141 | + }, |
| 142 | + "expected": [] |
| 143 | + }, |
| 144 | + { |
| 145 | + "uuid": "779bf69a-f5c4-4b53-949f-3f05fd4bd814", |
| 146 | + "description": "Students are sorted by name in a grade", |
| 147 | + "property": "roster", |
| 148 | + "input": { |
| 149 | + "students": [["Franklin", 5], ["Bradley", 5], ["Jeff", 1]], |
| 150 | + "desiredGrade": 5 |
| 151 | + }, |
| 152 | + "expected": ["Bradley", "Franklin"] |
| 153 | + } |
| 154 | + ] |
| 155 | +} |
0 commit comments