Пример #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());
 }
Пример #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());
 }