use of com.artezio.arttime.datamodel.Period in project ART-TIME by Artezio.
the class MonthSelectorTest method setPreviousPeriod.
@Test
public void setPreviousPeriod() throws ParseException, NoSuchFieldException {
Date firstDayOfMonth = sdf.parse("1-05-2014");
Date lastDayOfMonth = sdf.parse("31-05-2014");
Period period = new Period(firstDayOfMonth, lastDayOfMonth);
setField(monthSelector, "period", period);
Period expected = new Period(sdf.parse("1-04-2014"), sdf.parse("30-04-2014"));
monthSelector.setPreviousPeriod();
Period actual = (Period) getField(monthSelector, "period");
assertEquals(expected, actual);
}
use of com.artezio.arttime.datamodel.Period in project ART-TIME by Artezio.
the class CustomPeriodSelectorTest method setPreviousPeriod.
@Test
public void setPreviousPeriod() throws ParseException, NoSuchFieldException {
Date firstDayOfPeriod = sdf.parse("1-05-2014");
Date lastDayOfPeriod = sdf.parse("10-05-2014");
Period period = new Period(firstDayOfPeriod, lastDayOfPeriod);
setField(periodSelector, "period", period);
Period expected = new Period(sdf.parse("21-04-2014"), sdf.parse("30-04-2014"));
periodSelector.setPreviousPeriod();
Period actual = (Period) getField(periodSelector, "period");
assertEquals(expected, actual);
}
use of com.artezio.arttime.datamodel.Period in project ART-TIME by Artezio.
the class CustomPeriodSelectorTest method setNextPeriod.
@Test
public void setNextPeriod() throws ParseException, NoSuchFieldException {
Date firstDayOfPeriod = sdf.parse("1-05-2014");
Date lastDayOfPeriod = sdf.parse("10-05-2014");
Period period = new Period(firstDayOfPeriod, lastDayOfPeriod);
setField(periodSelector, "period", period);
Period expected = new Period(sdf.parse("11-05-2014"), sdf.parse("20-05-2014"));
periodSelector.setNextPeriod();
Period actual = (Period) getField(periodSelector, "period");
assertEquals(expected, actual);
}
use of com.artezio.arttime.datamodel.Period in project ART-TIME by Artezio.
the class ReportedHoursIndicatorTest method setUp.
@Before
public void setUp() throws Exception {
loggedEmployee = new Employee(userName);
hoursIndicator = createMockBuilder(ReportedHoursIndicator.class).addMockedMethod("getFilter").createMock();
period = new Period();
workTimeService = createMock(WorkTimeService.class);
employeeService = createMock(EmployeeService.class);
filter = createMock(Filter.class);
hourTypeService = createMock(HourTypeService.class);
expect(employeeService.getLoggedEmployee()).andReturn(Optional.of(loggedEmployee)).anyTimes();
replay(employeeService);
setField(hoursIndicator, "workTimeService", workTimeService);
setField(hoursIndicator, "employeeService", employeeService);
setField(hoursIndicator, "hourTypeService", hourTypeService);
}
use of com.artezio.arttime.datamodel.Period in project ART-TIME by Artezio.
the class WeekSelectorTest method setPreviousPeriod.
@Test
public void setPreviousPeriod() throws ParseException, NoSuchFieldException {
Date firstDayOfWeek = sdf.parse("28-04-2014");
Date lastDayOfWeek = sdf.parse("4-05-2014");
Period period = new Period(firstDayOfWeek, lastDayOfWeek);
setField(weekSelector, "period", period);
Period expected = new Period(sdf.parse("21-04-2014"), sdf.parse("27-04-2014"));
weekSelector.setPreviousPeriod();
Period actual = (Period) getField(weekSelector, "period");
assertEquals(expected, actual);
}
Aggregations