Example #1
0
 @Test
 public void writeTest() {
   t.writeCharacter('c');
   assertEquals('c', t.readCharacter());
   t.moveRight();
   t.writeCharacter('c');
   assertEquals('c', t.readCharacter());
   t.moveRight();
   t.writeCharacter('c');
   assertEquals('c', t.readCharacter());
 }
Example #2
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());
 }
Example #3
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());
 }