@Test public final void testReferenceData() { // Use an EditBooleanVar to test since it is a very basic // implementation of EditBaseVar. final EditBaseVar ev = new EditBooleanVar(fModelService); assertEquals(Variable.KEY_MAX, ev.getKeyMax()); assertEquals(DisplayNameConditions.DISPLAY_NAME_MAX, ev.getDisplayNameMax()); assertEquals(fModelService.getAllVariableGroups(), ev.getAllGroups()); }
@Test public final void testSetGroupValid() { // Setup final VariableGroup newGroup = fModelService.getAllVariableGroups().iterator().next(); // Use an EditBooleanVar to test since it is a very basic // implementation of EditBaseVar. final EditBaseVar ev = new EditBooleanVar(fModelService); // Ensure we're actually going to test something here. assertNotEquals(newGroup.getId(), ev.getGroupId()); // Operation ev.setGroupId(newGroup.getId()); // Verification assertEquals(newGroup.getId(), ev.getGroupId()); assertEquals(newGroup, ev.getGroup().get()); }