use of ai.elimu.model.analytics.LetterLearningEvent in project webapp by elimu-ai.
the class LetterLearningEventDaoTest method testReadAllByStudent.
@Test
public void testReadAllByStudent() {
Student student = new Student();
student.setUniqueId("ddhe72a08347cd29bd3f43d_1");
studentDao.create(student);
List<LetterLearningEvent> letterLearningEvents = letterLearningEventDao.readAll(student);
assertThat(letterLearningEvents.size(), is(0));
LetterLearningEvent letterLearningEvent = new LetterLearningEvent();
letterLearningEvent.setStudent(student);
letterLearningEventDao.create(letterLearningEvent);
letterLearningEvents = letterLearningEventDao.readAll(student);
assertThat(letterLearningEvents.size(), is(1));
assertThat(letterLearningEvents.get(0).getStudent().getUniqueId(), is("ddhe72a08347cd29bd3f43d_1"));
}
use of ai.elimu.model.analytics.LetterLearningEvent in project webapp by elimu-ai.
the class LetterLearningEventDaoTest method testReadAllByApplication.
@Test
public void testReadAllByApplication() {
Application application = new Application();
application.setPackageName("ai.elimu.handwriting");
applicationDao.create(application);
List<LetterLearningEvent> letterLearningEvents = letterLearningEventDao.readAll(application);
assertThat(letterLearningEvents.size(), is(0));
LetterLearningEvent letterLearningEvent = new LetterLearningEvent();
letterLearningEvent.setApplication(application);
letterLearningEventDao.create(letterLearningEvent);
letterLearningEvents = letterLearningEventDao.readAll(application);
assertThat(letterLearningEvents.size(), is(1));
assertThat(letterLearningEvents.get(0).getApplication().getPackageName(), is("ai.elimu.handwriting"));
}
use of ai.elimu.model.analytics.LetterLearningEvent in project webapp by elimu-ai.
the class LetterLearningEventDaoTest method testReadAllByDevice.
@Test
public void testReadAllByDevice() {
Device device = new Device();
device.setDeviceId("ddhe72a08347cd29bd3f43d");
deviceDao.create(device);
List<LetterLearningEvent> letterLearningEvents = letterLearningEventDao.readAll(device);
assertThat(letterLearningEvents.size(), is(0));
Letter letter = new Letter();
letter.setText("a");
letterDao.create(letter);
LetterLearningEvent letterLearningEvent = new LetterLearningEvent();
letterLearningEvent.setDevice(device);
letterLearningEvent.setLetter(letter);
letterLearningEventDao.create(letterLearningEvent);
letterLearningEvents = letterLearningEventDao.readAll(device);
assertThat(letterLearningEvents.size(), is(1));
assertThat(letterLearningEvents.get(0).getLetter().getText(), is("a"));
}
Aggregations