Beispiel #1
0
  @Test
  public void testConstructor() {

    assertEquals("Tag 'Tag Name'", tag.toString());
    assertEquals("Tag Description", tag.getDescription());
    assertNull(tag.getParent());
    assertEquals(0, tag.getChildren().size());
    assertEquals(TagType.NodeTag, tag.getType());
  }
Beispiel #2
0
  @Test
  public void testSetName()
      throws CouldntSaveDataException,
          com.google.security.zynamics.binnavi.Database.Exceptions.CouldntSaveDataException {
    final MockTagListener listener = new MockTagListener();

    tag.addListener(listener);

    tag.setName("N1");

    assertEquals("N1", tag.getName());
    assertEquals("N1", tagNode.getObject().getName());
    assertEquals("changedName;", listener.events);

    tagNode.getObject().setName("N2");

    assertEquals("N2", tag.getName());
    assertEquals("N2", tagNode.getObject().getName());
    assertEquals("changedName;changedName;", listener.events);

    tag.removeListener(listener);
  }