use of me.vertretungsplan.objects.SubstitutionScheduleDay in project substitution-schedule-parser by vertretungsplanme.
the class IndiwareDemoTest method testEquals.
@Test
public void testEquals() throws IOException, JSONException {
SubstitutionScheduleDay scheduleXML = parser.parseIndiwareDay(Jsoup.parse(xml, "", Parser.xmlParser()), false);
SubstitutionScheduleDay scheduleHTML = parser.parseIndiwareDay(Jsoup.parse(html), true);
assertEquals(scheduleXML, scheduleHTML);
}
use of me.vertretungsplan.objects.SubstitutionScheduleDay in project substitution-schedule-parser by vertretungsplanme.
the class IndiwareDemoTest method demoTestHTML.
@Test
public void demoTestHTML() throws IOException, JSONException {
SubstitutionScheduleDay schedule = parser.parseIndiwareDay(Jsoup.parse(html), true);
verify(schedule);
}
use of me.vertretungsplan.objects.SubstitutionScheduleDay in project substitution-schedule-parser by vertretungsplanme.
the class IphisDemoTest method demoTest.
@Test
public void demoTest() throws IOException, JSONException {
SubstitutionSchedule schedule = new SubstitutionSchedule();
parser.parseIphis(schedule, changes, courses, teachers, messages);
assertEquals(2, schedule.getDays().size());
SubstitutionScheduleDay firstDay = schedule.getDays().get(0);
assertEquals(new LocalDate(2017, 9, 29), firstDay.getDate());
assertEquals(4, firstDay.getSubstitutions().size());
}
use of me.vertretungsplan.objects.SubstitutionScheduleDay in project substitution-schedule-parser by vertretungsplanme.
the class LegionBoardDemoTest method demoTest.
@Test
public void demoTest() throws IOException, JSONException {
SubstitutionSchedule schedule = new SubstitutionSchedule();
parser.parseLegionBoard(schedule, changes, courses, teachers);
assertEquals(3, schedule.getDays().size());
SubstitutionScheduleDay firstDay = schedule.getDays().get(0);
assertEquals(new LocalDate(2016, 9, 2), firstDay.getDate());
assertEquals(2, firstDay.getSubstitutions().size());
}
use of me.vertretungsplan.objects.SubstitutionScheduleDay in project substitution-schedule-parser by vertretungsplanme.
the class SVPlanDemoTest method demoTest3.
@Test
public void demoTest3() throws IOException, JSONException {
List<Document> docs = new ArrayList<>();
docs.add(Jsoup.parse(html3));
SubstitutionSchedule schedule = parser.parseSVPlanSchedule(docs);
assertEquals(new LocalDateTime(2017, 5, 2, 7, 19), schedule.getLastChange());
assertEquals(1, schedule.getDays().size());
SubstitutionScheduleDay day = schedule.getDays().get(0);
assertEquals(new LocalDate(2017, 5, 2), day.getDate());
assertEquals(32, day.getSubstitutions().size());
assertEquals(0, day.getMessages().size());
for (Substitution subst : day.getSubstitutions()) {
if (!subst.getSubject().equals("Profi"))
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