GraphicalSettings { public Collection<String> getSupportedEnumerations() { return enumerationMap.get(getSetting(GRAPHICAL_EVALUATOR)); } GraphicalSettings(GraphicalManifestation manifestation); Object getNamedObject(String name); List<Brush> getLayers(); void updateManifestation(); Collection<Shape> getSupportedShapes(); Collection<Color> getSupportedColors(); Collection<Object> getSupportedEvaluators(); Set<String> getSupportedFills(); Collection<String> getSupportedEnumerations(); boolean isValidKey(String key); Object getSetting(String name); void setByObject(String key, Object value); static final String NO_EVALUATOR; static final String GRAPHICAL_SHAPE; static final String GRAPHICAL_BACKGROUND_COLOR; static final String GRAPHICAL_OUTLINE_COLOR; static final String GRAPHICAL_OUTLINE_WEIGHT; static final String GRAPHICAL_FOREGROUND_FILL; static final String GRAPHICAL_FOREGROUND_COLOR; static final String GRAPHICAL_FOREGROUND_MIN; static final String GRAPHICAL_FOREGROUND_MAX; static final String GRAPHICAL_EVALUATOR; static final String GRAPHICAL_EVALUATOR_MAP; static final String DEFAULT_SHAPE; static final String DEFAULT_BACKGROUND_COLOR; static final String DEFAULT_OUTLINE_COLOR; static final String DEFAULT_OUTLINE_WEIGHT; static final String DEFAULT_FOREGROUND_FILL; static final String DEFAULT_FOREGROUND_COLOR; static final String DEFAULT_FOREGROUND_MIN; static final String DEFAULT_FOREGROUND_MAX; static final String DEFAULT_EVALUATOR; static final String DEFAULT_EVALUATOR_MAP; }
@Test public void testEnumerations() { Assert.assertTrue(settings.getSupportedEnumerations().isEmpty()); Mockito.when(mockComponent.getReferencingComponents()).thenReturn(Collections.<AbstractComponent>singletonList(mockEnumerator)); Mockito.when(mockViewProperties.getProperty(GraphicalSettings.GRAPHICAL_EVALUATOR, String.class)) .thenReturn(ENUMERATOR_NAME); settings = new GraphicalSettings(mockView); Collection<String> enumerations = settings.getSupportedEnumerations(); Assert.assertNotNull(enumerations); Assert.assertEquals(enumerations.size(), 2); Iterator<String> it = enumerations.iterator(); Assert.assertEquals(it.next(), "abc"); Assert.assertEquals(it.next(), "xyz"); }