Ejemplo n.º 1
0
  @Test
  public void checkDuplicateCalls() {
    IElement dummy = getDummy(elementClass);

    assertTrue(dataStructure.add(dummy));
    assertFalse(dataStructure.add(dummy));

    assertTrue(dataStructure.remove(dummy));
    assertFalse(dataStructure.remove(dummy));
  }
Ejemplo n.º 2
0
 @Test
 public void checkAddAndRemove() {
   IElement dummy = mock(elementClass);
   if (dummy instanceof Edge) {
     when(((Edge) dummy).getHashString()).thenReturn("1");
   }
   assertFalse(dataStructure.contains(dummy));
   assertEquals(0, dataStructure.size());
   assertTrue(dataStructure.add(dummy));
   assertTrue(dataStructure.contains(dummy));
   assertEquals(1, dataStructure.size());
   assertTrue(dataStructure.remove(dummy));
   assertFalse(dataStructure.contains(dummy));
   assertEquals(0, dataStructure.size());
 }