use of com.artezio.arttime.web.spread_sheet.SpreadSheet in project ART-TIME by Artezio.
the class TimesheetBeanTest method testGetSpreadSheet_ifNotNull.
@Test
public void testGetSpreadSheet_ifNotNull() throws ReflectiveOperationException {
setField(bean, "spreadSheet", spreadSheet);
SpreadSheet actual = bean.getSpreadSheet();
assertSame(spreadSheet, actual);
}
use of com.artezio.arttime.web.spread_sheet.SpreadSheet in project ART-TIME by Artezio.
the class ManageEffortsBeanTest method testShowMasterProjectTotalsLabel_ifGroupingByProject_AndShow.
@Test
public void testShowMasterProjectTotalsLabel_ifGroupingByProject_AndShow() throws NoSuchFieldException {
Project project1 = new Project();
Project project2 = new Project();
Sheet sheet = createMock(Sheet.class);
SpreadSheet spreadSheet = createMock(SpreadSheet.class);
HeadSpreadSheetRow row1 = new HeadSpreadSheetRow(project1);
HeadSpreadSheetRow row2 = new HeadSpreadSheetRow(project2);
setField(project1, "id", 1L);
setField(project2, "id", 2L);
setField(manageEffortsBean, "grouping", BY_PROJECTS);
setField(manageEffortsBean, "spreadSheet", spreadSheet);
expect(spreadSheet.getSheet()).andReturn(sheet);
expect(sheet.getRowIndex()).andReturn(1);
expect(spreadSheet.getRows()).andReturn(Arrays.asList(row1, row2));
replay(spreadSheet, sheet);
boolean actual = manageEffortsBean.showMasterProjectTotalsLabel(row2);
verify(spreadSheet, sheet);
assertTrue(actual);
}
use of com.artezio.arttime.web.spread_sheet.SpreadSheet in project ART-TIME by Artezio.
the class EffortsBeanTest method testGetSpreadSheet_ifNull.
@Test
public void testGetSpreadSheet_ifNull() throws Exception {
effortsBean = createMockBuilder(EffortsBean.class).addMockedMethod("initSpreadSheet").createMock();
setField(effortsBean, "spreadSheet", null);
SpreadSheet spreadSheet = createMock(SpreadSheet.class);
expect(effortsBean.initSpreadSheet()).andReturn(spreadSheet);
replay(effortsBean);
SpreadSheet actual = effortsBean.getSpreadSheet();
verify(effortsBean);
assertSame(spreadSheet, actual);
}
use of com.artezio.arttime.web.spread_sheet.SpreadSheet in project ART-TIME by Artezio.
the class EffortsBeanTest method testGetSpreadSheet_ifNotNull.
@Test
public void testGetSpreadSheet_ifNotNull() throws Exception {
SpreadSheet spreadSheet = createMock(SpreadSheet.class);
setField(effortsBean, "spreadSheet", spreadSheet);
SpreadSheet actual = effortsBean.getSpreadSheet();
assertSame(spreadSheet, actual);
}
use of com.artezio.arttime.web.spread_sheet.SpreadSheet in project ART-TIME by Artezio.
the class ManageEffortsBeanTest method testInitProjectEffortsSpreadSheet.
@Test
public void testInitProjectEffortsSpreadSheet() throws Exception {
manageEffortsBean = new ManageEffortsBean();
ProjectEffortsSpreadSheetBuildingStrategy strategy = createMock(ProjectEffortsSpreadSheetBuildingStrategy.class);
EmployeeService employeeService = mock(EmployeeService.class);
setField(strategy, "employeeService", employeeService);
Filter filter = createMock(Filter.class);
setField(manageEffortsBean, "grouping", BY_PROJECTS);
setField(manageEffortsBean, "filterBean", filterBean);
setField(manageEffortsBean, "employeeService", employeeService);
EasyMock.expect(filterService.getActiveProjectsFilter()).andReturn(filter);
EasyMock.expect(filterBean.getCurrentFilter()).andReturn(filter);
expect(employeeService.getEffortsEmployees()).andReturn(Collections.emptyList());
replay(employeeService, filterBean, strategy);
SpreadSheet actual = manageEffortsBean.initSpreadSheet();
verify(employeeService, filterBean, strategy);
assertEquals(ProjectEffortsSpreadSheet.class, actual.getClass());
}
Aggregations