-
-
Notifications
You must be signed in to change notification settings - Fork 169
Closed
Description
When implementing this exercise I assumed a student could only belong in a single grade. This requirement makes the exercise interesting because the most convenient storage data structure is not the one that is meant to serve as output, and I wonder to which degree this wasn't the intended challenge underlying this exercise.
I thus propose adding the following test to the exercise:
it("A student can't be in two different grades", () => {
gradeSchool.addStudent('Aimee', 2)
gradeSchool.addStudent('Aimee', 1)
const emptyGrade = gradeSchool.studentsInGrade(2)
const expectedDb = new Map(Object.entries({ 2: ['Aimee'] }))
expect(emptyGrade).toEqual([])
})
I would like to make a pull-request with this change, but first I wanted to confirm if this implicit requirement makes sense.
Metadata
Metadata
Assignees
Labels
No labels