use of ai.elimu.model.analytics.NumberLearningEvent in project webapp by elimu-ai.
the class NumberLearningEventDaoTest method testReadAllByApplication.
@Test
public void testReadAllByApplication() {
Application application = new Application();
application.setPackageName("ai.elimu.handwriting");
applicationDao.create(application);
List<NumberLearningEvent> numberLearningEvents = numberLearningEventDao.readAll(application);
assertThat(numberLearningEvents.size(), is(0));
NumberLearningEvent numberLearningEvent = new NumberLearningEvent();
numberLearningEvent.setApplication(application);
numberLearningEventDao.create(numberLearningEvent);
numberLearningEvents = numberLearningEventDao.readAll(application);
assertThat(numberLearningEvents.size(), is(1));
assertThat(numberLearningEvents.get(0).getApplication().getPackageName(), is("ai.elimu.handwriting"));
}
use of ai.elimu.model.analytics.NumberLearningEvent in project webapp by elimu-ai.
the class NumberLearningEventDaoTest method testReadAllByDevice.
@Test
public void testReadAllByDevice() {
Device device = new Device();
device.setDeviceId("576de45ad9e0b07cf66");
deviceDao.create(device);
List<NumberLearningEvent> numberLearningEvents = numberLearningEventDao.readAll(device);
assertThat(numberLearningEvents.size(), is(0));
Number number = new Number();
number.setValue(1);
numberDao.create(number);
NumberLearningEvent numberLearningEvent = new NumberLearningEvent();
numberLearningEvent.setDevice(device);
numberLearningEvent.setNumber(number);
numberLearningEventDao.create(numberLearningEvent);
numberLearningEvents = numberLearningEventDao.readAll(device);
assertThat(numberLearningEvents.size(), is(1));
assertThat(numberLearningEvents.get(0).getNumber().getValue(), is(1));
}
use of ai.elimu.model.analytics.NumberLearningEvent in project webapp by elimu-ai.
the class NumberLearningEventDaoTest method testReadAllByStudent.
@Test
public void testReadAllByStudent() {
Student student = new Student();
student.setUniqueId("576de45ad9e0b07cf66_1");
studentDao.create(student);
List<NumberLearningEvent> numberLearningEvents = numberLearningEventDao.readAll(student);
assertThat(numberLearningEvents.size(), is(0));
NumberLearningEvent numberLearningEvent = new NumberLearningEvent();
numberLearningEvent.setStudent(student);
numberLearningEventDao.create(numberLearningEvent);
numberLearningEvents = numberLearningEventDao.readAll(student);
assertThat(numberLearningEvents.size(), is(1));
assertThat(numberLearningEvents.get(0).getStudent().getUniqueId(), is("576de45ad9e0b07cf66_1"));
}
Aggregations