use of com.lassitercg.faces.components.sheet.Sheet 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.lassitercg.faces.components.sheet.Sheet in project ART-TIME by Artezio.
the class ManageEffortsBeanTest method testShowMasterProjectTotalsLabel_ifGroupingByProject_AndNotShow.
@Test
public void testShowMasterProjectTotalsLabel_ifGroupingByProject_AndNotShow() throws NoSuchFieldException {
Project project = new Project();
Sheet sheet = createMock(Sheet.class);
SpreadSheet spreadSheet = createMock(SpreadSheet.class);
HeadSpreadSheetRow row1 = new HeadSpreadSheetRow(project);
HeadSpreadSheetRow row2 = new HeadSpreadSheetRow(project);
setField(manageEffortsBean, "grouping", BY_PROJECTS);
setField(project, "id", 1L);
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);
assertFalse(actual);
}
Aggregations