use of ai.elimu.model.Student 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.Student 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"));
}
use of ai.elimu.model.Student in project webapp by elimu-ai.
the class StudentDaoTest method testStoreStudentWithTWoDevices.
@Test
public void testStoreStudentWithTWoDevices() {
Set<Device> devices = new HashSet<>();
Device device1 = new Device();
device1.setDeviceId("2223947bec18b7ad");
deviceDao.create(device1);
devices.add(device1);
Device device2 = new Device();
device2.setDeviceId("679b35bb2322c6e4");
deviceDao.create(device2);
devices.add(device2);
Student student = new Student();
student.setUniqueId("2223947bec18b7ad_1");
student.setDevices(devices);
studentDao.create(student);
Student studentStoredInDatabase = studentDao.read("2223947bec18b7ad_1");
assertThat(studentStoredInDatabase.getDevices().size(), is(2));
}
use of ai.elimu.model.Student in project webapp by elimu-ai.
the class StudentDaoTest method testCreateStudentsWithNonUniqueIds.
@Test(expected = JpaSystemException.class)
public void testCreateStudentsWithNonUniqueIds() {
Student student1 = new Student();
student1.setUniqueId("4113947bec18b7ad_1");
studentDao.create(student1);
Student student2 = new Student();
student2.setUniqueId("4113947bec18b7ad_1");
studentDao.create(student2);
}
use of ai.elimu.model.Student in project webapp by elimu-ai.
the class StudentDaoTest method testStoreStudentWithOneDevice.
@Test
public void testStoreStudentWithOneDevice() {
Set<Device> devices = new HashSet<>();
Device device = new Device();
device.setDeviceId("4113947bec18b7ad");
deviceDao.create(device);
devices.add(device);
Student student = new Student();
student.setUniqueId("4113947bec18b7ad_1");
student.setDevices(devices);
studentDao.create(student);
Student studentStoredInDatabase = studentDao.read("4113947bec18b7ad_1");
assertThat(studentStoredInDatabase.getDevices().size(), is(1));
}
Aggregations