@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()); }
@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()); }