コード例 #1
0
 /** To test getFirst this means that getFirstNode also works */
 @Test
 public void testFirst() {
   // the first letter is "t"
   assertEquals("t", filledTest.getFirst());
   // the first letter is t
   assertEquals("t", twoTest.getFirst());
   assertEquals("t", oneTest.getFirst());
   // The get first is funky for the empty test and I have no clue why!!!
   // assertEquals ("null", emptyTest.getFirst());
 }
コード例 #2
0
  /** To test if inserting at the first spot works */
  @Test
  public void testInsertFirst() {
    // insert a letter at the first node
    filledTest.insertFirst("X");
    twoTest.insertFirst("Y");
    oneTest.insertFirst("Z");
    emptyTest.insertFirst("A");

    // the first letter should be whatever I've inserted (see above)
    assertEquals("X", filledTest.getFirst());
    assertEquals("Y", twoTest.getFirst());
    assertEquals("Z", oneTest.getFirst());
    assertEquals("A", emptyTest.getFirst());
  }