Search in sources :

Example 31 with WorkdaysCalendar

use of com.artezio.arttime.datamodel.WorkdaysCalendar in project ART-TIME by Artezio.

the class EmployeesBeanTest method testFilterByCalendar_valueNull_filterContainsNull.

@Test
public void testFilterByCalendar_valueNull_filterContainsNull() throws NoSuchFieldException {
    WorkdaysCalendar calendar = new WorkdaysCalendar("calendar1");
    setField(calendar, "id", 1L);
    boolean actual = bean.filterByCalendar(null, Arrays.asList(new Object(), null), null);
    assertTrue(actual);
}
Also used : WorkdaysCalendar(com.artezio.arttime.datamodel.WorkdaysCalendar) Test(org.junit.Test)

Example 32 with WorkdaysCalendar

use of com.artezio.arttime.datamodel.WorkdaysCalendar in project ART-TIME by Artezio.

the class EmployeesBeanTest method testFilterByCalendar_valueNull_filterNotContainsNull.

@Test
public void testFilterByCalendar_valueNull_filterNotContainsNull() throws NoSuchFieldException {
    WorkdaysCalendar calendar = new WorkdaysCalendar("calendar1");
    setField(calendar, "id", 1L);
    boolean actual = bean.filterByCalendar(null, Arrays.asList(new Object()), null);
    assertFalse(actual);
}
Also used : WorkdaysCalendar(com.artezio.arttime.datamodel.WorkdaysCalendar) Test(org.junit.Test)

Example 33 with WorkdaysCalendar

use of com.artezio.arttime.datamodel.WorkdaysCalendar in project ART-TIME by Artezio.

the class EmployeesBeanTest method testFilterByCalendar_valueNull_filterNull.

@Test
public void testFilterByCalendar_valueNull_filterNull() throws NoSuchFieldException {
    WorkdaysCalendar calendar = new WorkdaysCalendar("calendar1");
    setField(calendar, "id", 1L);
    boolean actual = bean.filterByCalendar(null, null, null);
    assertTrue(actual);
}
Also used : WorkdaysCalendar(com.artezio.arttime.datamodel.WorkdaysCalendar) Test(org.junit.Test)

Example 34 with WorkdaysCalendar

use of com.artezio.arttime.datamodel.WorkdaysCalendar in project ART-TIME by Artezio.

the class EmployeesBeanTest method testFilterByCalendar_FilterIsNull.

@Test
public void testFilterByCalendar_FilterIsNull() throws NoSuchFieldException {
    WorkdaysCalendar calendar = new WorkdaysCalendar("calendar1");
    setField(calendar, "id", 1L);
    boolean actual = bean.filterByCalendar(calendar, null, null);
    assertTrue(actual);
}
Also used : WorkdaysCalendar(com.artezio.arttime.datamodel.WorkdaysCalendar) Test(org.junit.Test)

Example 35 with WorkdaysCalendar

use of com.artezio.arttime.datamodel.WorkdaysCalendar in project ART-TIME by Artezio.

the class EmployeesBeanTest method testFilterByCalendar_NonNullValueOutOfFilter.

@Test
public void testFilterByCalendar_NonNullValueOutOfFilter() throws NoSuchFieldException {
    WorkdaysCalendar calendar1 = new WorkdaysCalendar("calendar1");
    setField(calendar1, "id", 1L);
    WorkdaysCalendar calendar2 = new WorkdaysCalendar("calendar2");
    setField(calendar2, "id", 2L);
    WorkdaysCalendar calendar3 = new WorkdaysCalendar("calendar3");
    setField(calendar3, "id", 3L);
    List<WorkdaysCalendar> filter = Arrays.asList(calendar1, calendar2);
    boolean actual = bean.filterByCalendar(calendar3, filter, null);
    assertFalse(actual);
}
Also used : WorkdaysCalendar(com.artezio.arttime.datamodel.WorkdaysCalendar) Test(org.junit.Test)

Aggregations

WorkdaysCalendar (com.artezio.arttime.datamodel.WorkdaysCalendar)76 Test (org.junit.Test)65 Day (com.artezio.arttime.datamodel.Day)23 CalendarUtils.getOffsetDate (com.artezio.arttime.test.utils.CalendarUtils.getOffsetDate)17 Employee (com.artezio.arttime.datamodel.Employee)16 Period (com.artezio.arttime.datamodel.Period)11 Date (java.util.Date)10 Project (com.artezio.arttime.datamodel.Project)8 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)7 SimpleDateFormat (java.text.SimpleDateFormat)5 DateFormat (java.text.DateFormat)3 Before (org.junit.Before)3 HourType (com.artezio.arttime.datamodel.HourType)2 Hours (com.artezio.arttime.datamodel.Hours)2 EmployeeRepository (com.artezio.arttime.repositories.EmployeeRepository)2 BigDecimal (java.math.BigDecimal)2 GregorianCalendar (java.util.GregorianCalendar)2 HashMap (java.util.HashMap)2 WebCached (com.artezio.arttime.admin_tool.cache.WebCached)1 Scope (com.artezio.arttime.admin_tool.cache.WebCached.Scope)1