use of com.artezio.arttime.datamodel.WorkdaysCalendar in project ART-TIME by Artezio.
the class WorkdaysCalendarBeanTest method createDay.
private Day createDay(Long id, Date date) throws Exception {
WorkdaysCalendar workdaysCalendar = new WorkdaysCalendar();
setField(calendarBean, "workdaysCalendar", workdaysCalendar);
Day day = new Day(date, workdaysCalendar);
setField(day, "id", id);
return day;
}
use of com.artezio.arttime.datamodel.WorkdaysCalendar in project ART-TIME by Artezio.
the class EmployeesBeanTest method testFilterByCalendar_FilterIsEmpty.
@Test
public void testFilterByCalendar_FilterIsEmpty() throws NoSuchFieldException {
WorkdaysCalendar calendar = new WorkdaysCalendar("calendar1");
setField(calendar, "id", 1L);
List<WorkdaysCalendar> filter = Collections.emptyList();
boolean actual = bean.filterByCalendar(calendar, filter, null);
assertTrue(actual);
}
use of com.artezio.arttime.datamodel.WorkdaysCalendar in project ART-TIME by Artezio.
the class EmployeesBeanTest method testFilterByCalendar.
@Test
public void testFilterByCalendar() throws NoSuchFieldException {
WorkdaysCalendar calendar1 = new WorkdaysCalendar("calendar1");
setField(calendar1, "id", 1L);
WorkdaysCalendar calendar2 = new WorkdaysCalendar("calendar2");
setField(calendar2, "id", 2L);
List<WorkdaysCalendar> filter = Arrays.asList(calendar1, calendar2);
boolean actual = bean.filterByCalendar(calendar1, filter, null);
assertTrue(actual);
}
use of com.artezio.arttime.datamodel.WorkdaysCalendar in project ART-TIME by Artezio.
the class WorkdaysCalendarConverterTest method testGetAsObject_ifFoundInRepository.
@Test
public void testGetAsObject_ifFoundInRepository() throws Exception {
WorkdaysCalendar calendar = new WorkdaysCalendar();
expect(workdaysCalendarRepository.findWorkdaysCalendar(1L)).andReturn(calendar);
replay(workdaysCalendarRepository);
Object actual = converter.getAsObject(facesContext, component, "1");
verify(workdaysCalendarRepository);
assertSame(calendar, actual);
}
use of com.artezio.arttime.datamodel.WorkdaysCalendar in project ART-TIME by Artezio.
the class WorkdaysCalendarConverterTest method testGetAsString_ifWorkdaysCalendar.
@Test
public void testGetAsString_ifWorkdaysCalendar() throws Exception {
WorkdaysCalendar workdaysCalendar = new WorkdaysCalendar();
setField(workdaysCalendar, "id", 1L);
String actual = converter.getAsString(facesContext, component, workdaysCalendar);
assertEquals("1", actual);
}
Aggregations