use of me.vertretungsplan.objects.SubstitutionSchedule in project substitution-schedule-parser by vertretungsplanme.
the class ESchoolDemoTest method demoTest.
@Test
public void demoTest() throws IOException, JSONException {
SubstitutionSchedule schedule = parser.parseESchoolSchedule(Jsoup.parse(html));
assertEquals(new LocalDateTime(2016, 9, 4, 14, 53), schedule.getLastChange());
assertEquals(1, schedule.getDays().size());
SubstitutionScheduleDay day = schedule.getDays().get(0);
assertEquals(new LocalDate(2016, 9, 5), day.getDate());
assertEquals(6, day.getSubstitutions().size());
assertEquals(0, day.getMessages().size());
for (Substitution subst : day.getSubstitutions()) {
assertTrue(subst.getClasses().size() == 1);
assertNotEmpty(subst.getLesson());
assertNullOrNotEmpty(subst.getPreviousSubject());
assertNotEmpty(subst.getSubject());
assertNullOrNotEmpty(subst.getRoom());
assertNullOrNotEmpty(subst.getTeacher());
assertNullOrNotEmpty(subst.getPreviousTeacher());
assertNullOrNotEmpty(subst.getDesc());
assertNotEmpty(subst.getType());
}
}
Aggregations