use of me.vertretungsplan.objects.SubstitutionScheduleDay in project substitution-schedule-parser by vertretungsplanme.
the class IndiwareMobileDemoTest method demoTest.
@Test
public void demoTest() throws IOException, JSONException {
Document doc = Jsoup.parse(readResource("/indiware-mobile/indiware-mobile.xml"), "", Parser.xmlParser());
SubstitutionScheduleData scheduleData = new SubstitutionScheduleData();
scheduleData.setType(SubstitutionSchedule.Type.STUDENT);
SubstitutionScheduleDay day = IndiwareMobileParser.parseDay(doc, new ColorProvider(), scheduleData);
assertEquals(new LocalDate(2017, 6, 21), day.getDate());
assertEquals(new LocalDateTime(2017, 6, 20, 10, 28), day.getLastChange());
assertEquals(192, day.getSubstitutions().size());
}
use of me.vertretungsplan.objects.SubstitutionScheduleDay in project substitution-schedule-parser by vertretungsplanme.
the class DaVinciDemoTest method singleTest5.
@Test
public void singleTest5() throws IOException, JSONException {
SubstitutionSchedule schedule = new SubstitutionSchedule();
DaVinciParser.parsePage(Jsoup.parse(htmlSingleDaVinci5), schedule, parser.colorProvider);
assertEquals(3, schedule.getDays().size());
assertEquals(new LocalDateTime(2017, 1, 17, 7, 32), schedule.getLastChange());
SubstitutionScheduleDay day = schedule.getDays().get(0);
assertEquals(new LocalDate(2017, 1, 17), day.getDate());
assertEquals(2, day.getSubstitutions().size());
assertEquals(0, day.getMessages().size());
checkSubstitutions(day);
}
use of me.vertretungsplan.objects.SubstitutionScheduleDay in project substitution-schedule-parser by vertretungsplanme.
the class DaVinciDemoTest method singleTest6.
@Test
public void singleTest6() throws IOException, JSONException {
SubstitutionSchedule schedule = new SubstitutionSchedule();
DaVinciParser.parsePage(Jsoup.parse(htmlSingle), schedule, parser.colorProvider);
SubstitutionScheduleDay day = schedule.getDays().get(0);
assertEquals(new LocalDate(2016, 9, 5), day.getDate());
assertEquals(new LocalDateTime(2016, 9, 2, 13, 32), day.getLastChange());
assertEquals(23, day.getSubstitutions().size());
assertEquals(0, day.getMessages().size());
checkSubstitutions(day);
}
use of me.vertretungsplan.objects.SubstitutionScheduleDay 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