예제 #1
0
 @Test
 public void printTest() {
   System.out.println("Print-Test:");
   System.out.println(t.toString());
   System.out.println("moving right");
   t.moveRight();
   System.out.println(t.toString());
   System.out.println("moving left");
   t.moveLeft();
   System.out.println(t.toString());
   System.out.println("moving left");
   t.moveLeft();
   System.out.println(t.toString());
   System.out.println("moving left");
   t.moveLeft();
   System.out.println(t.toString());
   System.out.println("moving left");
   t.moveLeft();
   System.out.println(t.toString());
   System.out.println("moving left");
   t.moveLeft();
   System.out.println(t.toString());
   System.out.println("moving left");
   t.moveLeft();
   System.out.println(t.toString());
   System.out.println("moving left");
   t.moveLeft();
   System.out.println(t.toString());
 }
예제 #2
0
 @Test
 public void moveTest() {
   assertEquals("first character is wrong:", 'a', t.readCharacter());
   t.moveLeft();
   assertEquals("after moving to the left, there should be a blank:", blank, t.readCharacter());
   t.moveRight();
   t.moveRight();
   assertEquals('b', t.readCharacter());
   t.moveRight();
   assertEquals('c', t.readCharacter());
   t.moveRight();
   assertEquals(blank, t.readCharacter());
   t.moveRight();
   assertEquals(blank, t.readCharacter());
   t.moveLeft();
   t.moveLeft();
   assertEquals('c', t.readCharacter());
 }