Exemplo n.º 1
0
 /** Moo */
 @Test(expected = IndexOutOfBoundsException.class)
 public void testSetIndexOutOfBoundsException2() {
   assertEquals(0, words.size());
   words.add("6");
   words.add("7");
   words.set(2, "5");
 }
Exemplo n.º 2
0
  /** Moo */
  @Test
  public void testSet() {

    words.add("6");
    words.add("7");
    assertEquals("6", words.set(0, "3"));
    assertEquals("3", words.get(0));
    assertEquals("7", words.get(1));
    assertEquals(2, words.size());
  }
Exemplo n.º 3
0
 /** Moo */
 @Test(expected = IndexOutOfBoundsException.class)
 public void testAddIndexOutOfBoundsException() {
   assertEquals(0, words.size());
   words.set(-1, "5");
 }