Exemplo n.º 1
0
  @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());
  }
Exemplo n.º 2
0
  @Test
  public final void testCalculateDependentModels() {
    // Setup
    final BooleanVariable var = SampleModels.dnrVariable();
    // Use an EditBooleanVar to test since it is a very basic
    // implementation of EditBaseVar.
    final EditBaseVar ev = new EditBooleanVar(var, fModelService);

    // Verification
    assertEquals(ImmutableSet.of(fModelService.getThoracicModel()), ev.getDependentModels());
  }
Exemplo n.º 3
0
  @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());
  }