The intended structure of the School class is very hard to pin down. All of the add() calls are done directly on the School, but then for the first few tests, things (size, added students) are accessed through an arbitrary middle layer, db(). After the first few tests, suddenly the calls change from school.db().get({grade number}) to school.grade({grade number}).
Examples:
school.add("Chelsea", 3);
assertThat(school.db().get(3).size(), is(1));
assertThat(school.grade(5).size(), is(2));
If the point of the exercise is to force adherence to an arbitrary (and frankly ridiculous) structure, then I would consider it a great success.
The intended structure of the School class is very hard to pin down. All of the add() calls are done directly on the School, but then for the first few tests, things (size, added students) are accessed through an arbitrary middle layer,
db(). After the first few tests, suddenly the calls change fromschool.db().get({grade number})toschool.grade({grade number}).Examples:
school.add("Chelsea", 3);assertThat(school.db().get(3).size(), is(1));assertThat(school.grade(5).size(), is(2));If the point of the exercise is to force adherence to an arbitrary (and frankly ridiculous) structure, then I would consider it a great success.