Ejemplo n.º 1
0
 /** Test of elementExists method, of class Set. */
 @Test
 public void testElementExists() {
   Set<Integer> set = new Set<Integer>();
   assertFalse(set.elementExists(1));
   set.addElement(1);
   assertTrue(set.elementExists(1));
 }
Ejemplo n.º 2
0
 /** Test of addElement method, of class Set. */
 @Test
 public void testAddElement() {
   Set<String> set = new Set<String>();
   set.addElement("m");
   set.addElement("h");
   set.addElement("m");
   assertTrue(set.elementExists("m"));
   assertFalse(set.elementExists("n"));
 }
Ejemplo n.º 3
0
 /** Test of deleteElement method, of class Set. */
 @Test(expected = ElementNotFoundException.class)
 public void testDeleteElement() throws Exception {
   Set<Integer> set = new Set<Integer>();
   set.deleteElement(3);
   set.addElement(1);
   set.addElement(4);
   set.deleteElement(1);
   assertFalse(set.elementExists(1));
 }