ScenarioGrid extends BaseGridWidget { protected boolean isPropertyAssigned(boolean instanceAssigned, FactMapping factMapping) { if (FactIdentifier.DESCRIPTION.equals(factMapping.getFactIdentifier())) { return true; } else { return instanceAssigned && (isSimpleJavaType(factMapping.getClassName()) || !factMapping.getExpressionElements().isEmpty()); } } ScenarioGrid(AbstractScesimGridModel model,
                        ScenarioGridLayer scenarioGridLayer,
                        ScenarioGridRenderer renderer,
                        ScenarioContextMenuRegistry scenarioContextMenuRegistry); void setContent(AbstractScesimModel abstractScesimModel, ScenarioSimulationModel.Type type); GridWidget getGridWidget(); EventBus getEventBus(); void setEventBus(EventBus eventBus); void setDefaultSelectedDataCell(int cellX, int cellY); ScenarioSimulationContext getScenarioSimulationContext(); void setScenarioSimulationContext(ScenarioSimulationContext scenarioSimulationContext); @Override AbstractScesimGridModel getModel(); ScenarioSimulationModel.Type getType(); void clearSelections(); void setSelectedColumn(int columnIndex); void setSelectedColumnAndHeader(int headerRowIndex, int columnIndex); void ensureCellIsSelected(); void setSelectedCell(int rowIndex, int columnIndex); @Override boolean adjustSelection(final SelectionExtension direction, final boolean isShiftKeyDown);  }
@Test public void isPropertyAssigned() { factMappingDescription.getExpressionElements().clear(); assertTrue(scenarioGridSpy.isPropertyAssigned(false, factMappingDescription)); assertTrue(scenarioGridSpy.isPropertyAssigned(true, factMappingDescription)); factMappingDescription.getExpressionElements().add(new ExpressionElement(TEST)); assertTrue(scenarioGridSpy.isPropertyAssigned(false, factMappingDescription)); assertTrue(scenarioGridSpy.isPropertyAssigned(true, factMappingDescription)); factMappingGiven.getExpressionElements().clear(); assertFalse(scenarioGridSpy.isPropertyAssigned(false, factMappingGiven)); assertFalse(scenarioGridSpy.isPropertyAssigned(true, factMappingGiven)); factMappingGiven.getExpressionElements().add(new ExpressionElement("test")); assertFalse(scenarioGridSpy.isPropertyAssigned(false, factMappingGiven)); assertTrue(scenarioGridSpy.isPropertyAssigned(true, factMappingGiven)); factMappingInteger.getExpressionElements().clear(); assertFalse(scenarioGridSpy.isPropertyAssigned(false, factMappingInteger)); assertTrue(scenarioGridSpy.isPropertyAssigned(true, factMappingInteger)); }