use of com.artezio.arttime.datamodel.HourType in project ART-TIME by Artezio.
the class HourTypeRepositoryTest method testCreateHourType_notExistActualTime.
@Test
public void testCreateHourType_notExistActualTime() {
HourType notActualTime = new HourType("not actual");
notActualTime.setActualTime(false);
entityManager.persist(notActualTime);
HourType hourType = new HourType("hourType");
hourType.setActualTime(false);
HourType actual = hourTypeRepository.create(hourType);
assertEquals(hourType, actual);
assertTrue(actual.isActualTime());
}
use of com.artezio.arttime.datamodel.HourType in project ART-TIME by Artezio.
the class HourTypeRepositoryTest method testCreateHourType_ifExistActualTime.
@Test
public void testCreateHourType_ifExistActualTime() {
HourType actualTime = new HourType("actual");
actualTime.setActualTime(true);
entityManager.persist(actualTime);
HourType hourType = new HourType("hourType");
hourType.setActualTime(false);
HourType actual = hourTypeRepository.create(hourType);
assertEquals(hourType, actual);
assertFalse(actual.isActualTime());
}
use of com.artezio.arttime.datamodel.HourType in project ART-TIME by Artezio.
the class HourTypeRepositoryTest method testRemoveHourType.
@Test
public void testRemoveHourType() throws ActualTimeRemovalException {
HourType hourType = new HourType();
entityManager.persist(hourType);
Long id = hourType.getId();
hourTypeRepository.remove(hourType);
HourType actual = entityManager.find(HourType.class, id);
assertNull(actual);
}
use of com.artezio.arttime.datamodel.HourType in project ART-TIME by Artezio.
the class HourTypeRepositoryTest method testFindActual_ifNotSetActualTime.
@Test
public void testFindActual_ifNotSetActualTime() {
HourType unexpectedType1 = new HourType("unexpected type 1");
unexpectedType1.setActualTime(false);
HourType unexpectedType2 = new HourType("unexpected type 2");
unexpectedType2.setActualTime(false);
entityManager.persist(unexpectedType1);
entityManager.persist(unexpectedType2);
HourType actual = hourTypeRepository.findActual();
assertNull(actual);
}
use of com.artezio.arttime.datamodel.HourType in project ART-TIME by Artezio.
the class HourTypeRepositoryTest method testFind.
@Test
public void testFind() {
HourType expected = new HourType();
HourType unexpected = new HourType();
entityManager.persist(expected);
entityManager.persist(unexpected);
HourType actual = hourTypeRepository.find(expected.getId());
assertEquals(expected, actual);
}
Aggregations