use of com.artezio.arttime.datamodel.HourType in project ART-TIME by Artezio.
the class HoursSpreadSheetRowTest method testGetFirstColValue_ifGroupingByEmployees.
@Test
public void testGetFirstColValue_ifGroupingByEmployees() {
Project project = new Project();
project.setCode("project");
HourType hourType = new HourType();
Employee employee = new Employee("iivanov", "Ivan", "Ivanov", "ivanov@email");
row = new HoursSpreadSheetRow(project, employee, hourType, new ArrayList<>());
String actual = row.getFirstColValue(EffortsGrouping.BY_EMPLOYEES);
assertEquals(project.getCode(), actual);
}
use of com.artezio.arttime.datamodel.HourType in project ART-TIME by Artezio.
the class SampleDataRepository method initHourTypes.
private static void initHourTypes() throws IllegalAccessException {
hourTypes = new ArrayList<>();
HourType hourType1 = new HourType("actual_type_priority_1");
FieldUtils.writeField(hourType1, "id", 1L, true);
hourType1.setActualTime(true);
hourType1.setPriority(1);
hourTypes.add(hourType1);
HourType hourType2 = new HourType("not_actual_type_priority_2");
FieldUtils.writeField(hourType2, "id", 2L, true);
hourType2.setActualTime(false);
hourType2.setPriority(2);
hourTypes.add(hourType2);
HourType hourType3 = new HourType("not_actual_type_priority_3");
FieldUtils.writeField(hourType3, "id", 3L, true);
hourType3.setActualTime(false);
hourType3.setPriority(3);
hourTypes.add(hourType3);
}
use of com.artezio.arttime.datamodel.HourType in project ART-TIME by Artezio.
the class SpreadSheetTest method testGetFilteredHourTypes_IndexedHoursEmpty_FilterNotEmpty.
@Test
public void testGetFilteredHourTypes_IndexedHoursEmpty_FilterNotEmpty() {
HourType hourType1 = new HourType("1");
HourType hourType2 = new HourType("2");
filter.setHourTypes(asList(hourType2));
Project project = new Project();
project.setTeam(singletonList(employee1));
project.setAccountableHours(asList(hourType1, hourType2));
SpreadSheet.HoursIndexedBundle indexedHours = EasyMock.mock(SpreadSheet.HoursIndexedBundle.class);
expect(indexedHours.getHourTypes(project, employee1)).andReturn(emptyList());
EasyMock.replay(indexedHours);
List<HourType> expected = asList(hourType2);
List<HourType> actual = spreadSheet.getFilteredHourTypesUnion(employee1, project, indexedHours);
EasyMock.verify(indexedHours);
ListAssert.assertEquals(expected, actual);
}
use of com.artezio.arttime.datamodel.HourType in project ART-TIME by Artezio.
the class SpreadSheetTest method testGetFilteredHourTypes_IndexedHourTypesNotEmpty_FilterEmpty.
@Test
public void testGetFilteredHourTypes_IndexedHourTypesNotEmpty_FilterEmpty() {
HourType hourType1 = new HourType("1");
HourType hourType2 = new HourType("2");
Project project = new Project();
project.setTeam(singletonList(employee1));
project.setAccountableHours(asList(hourType1, hourType2));
SpreadSheet.HoursIndexedBundle indexedHours = EasyMock.mock(SpreadSheet.HoursIndexedBundle.class);
expect(indexedHours.getHourTypes(project, employee1)).andReturn(asList(hourType1, hourType2));
EasyMock.replay(indexedHours);
List<HourType> expected = asList(hourType1, hourType2);
List<HourType> actual = spreadSheet.getFilteredHourTypesUnion(employee1, project, indexedHours);
EasyMock.verify(indexedHours);
ListAssert.assertEquals(expected, actual);
}
use of com.artezio.arttime.datamodel.HourType in project ART-TIME by Artezio.
the class SpreadSheetTest method testGetFilteredHourTypes_IndexedHoursEmpty_FilterEmpty.
@Test
public void testGetFilteredHourTypes_IndexedHoursEmpty_FilterEmpty() {
HourType hourType1 = new HourType("1");
HourType hourType2 = new HourType("2");
Project project = new Project();
project.setTeam(singletonList(employee1));
project.setAccountableHours(asList(hourType1, hourType2));
SpreadSheet.HoursIndexedBundle indexedHours = EasyMock.mock(SpreadSheet.HoursIndexedBundle.class);
expect(indexedHours.getHourTypes(project, employee1)).andReturn(emptyList());
EasyMock.replay(indexedHours);
List<HourType> expected = asList(hourType1, hourType2);
List<HourType> actual = spreadSheet.getFilteredHourTypesUnion(employee1, project, indexedHours);
EasyMock.verify(indexedHours);
ListAssert.assertEquals(expected, actual);
}
Aggregations