use of com.artezio.arttime.datamodel.Employee in project ART-TIME by Artezio.
the class EmployeeRepositoryTest method testUpdate.
@Test
public void testUpdate() {
Employee employee = new Employee("iivanov", "Ivan", "Ivanov", "iivanov@mail.com");
entityManager.persist(employee);
employee.setEmail("ivan.ivanov@mail.com");
Employee actual = employeeRepository.update(employee);
assertEquals("ivan.ivanov@mail.com", actual.getEmail());
}
use of com.artezio.arttime.datamodel.Employee in project ART-TIME by Artezio.
the class EmployeeRepositoryTest method testCreate.
@Test
public void testCreate() {
Employee employee = new Employee("employee");
Employee actual = employeeRepository.create(employee);
actual = entityManager.find(Employee.class, actual.getUserName());
assertNotNull(actual);
}
use of com.artezio.arttime.datamodel.Employee in project ART-TIME by Artezio.
the class HoursRepositoryTest method testFindHours.
@Test
public void testFindHours() throws Exception {
Employee employee = new Employee("employ");
Project project = new Project();
project.setCode("PrCode");
HourType hourType = new HourType();
Date date = getOffsetDate(1);
Hours expected = new Hours(project, date, employee, hourType);
entityManager.persist(project);
entityManager.persist(employee);
entityManager.persist(hourType);
entityManager.persist(expected);
Hours actual = hoursRepository.findHours(employee.getUserName(), project.getCode(), hourType.getId(), date);
assertEquals(expected, actual);
}
use of com.artezio.arttime.datamodel.Employee in project ART-TIME by Artezio.
the class HoursRepositoryTest method testRemove.
@Test
public void testRemove() throws Exception {
Employee employee = new Employee("employe");
Project project = new Project();
HourType hourType = new HourType();
Hours hours = new Hours(project, sdf.parse("1-01-2015"), employee, hourType);
entityManager.persist(project);
entityManager.persist(employee);
entityManager.persist(hourType);
entityManager.persist(hours);
hoursRepository.remove(hours);
Hours actual = entityManager.find(Hours.class, hours.getId());
assertNull(actual);
}
use of com.artezio.arttime.datamodel.Employee in project ART-TIME by Artezio.
the class HoursRepositoryTest method testGetApprovedActualHours_ifEmployeesIsEmpty.
@Test
public void testGetApprovedActualHours_ifEmployeesIsEmpty() {
Period period = new Period();
List<Employee> employees = new ArrayList<>();
List<Hours> actual = hoursRepository.getApprovedActualHours(employees, period);
assertTrue(actual.isEmpty());
}
Aggregations