예제 #1
0
  @org.junit.Test
  public void testUsage() {
    char[] expectedChars = new char[] {'a', 'b', 'c'};

    for (int i = 0; i < expectedChars.length; i++) {
      assertEquals(instance.hasNext(), true);
      assertEquals(instance.peek(), expectedChars[i]);
      assertEquals((char) instance.next(), expectedChars[i]);
    }

    assertEquals(instance.hasNext(), false);
  }
예제 #2
0
 /** Test of next method, of class ReaderInput. */
 @org.junit.Test
 public void testNext() {
   System.out.println("next");
   Character expResult = 'a';
   Character result = instance.next();
   assertEquals(expResult, result);
 }
예제 #3
0
 /** Test of hasNext method, of class ReaderInput. */
 @org.junit.Test
 public void testHasNext() {
   System.out.println("hasNext");
   boolean expResult = true;
   boolean result = instance.hasNext();
   assertEquals(expResult, result);
 }
예제 #4
0
 /** Test of getFileName method, of class ReaderInput. */
 @org.junit.Test
 public void testGetFileName() {
   System.out.println("getFileName");
   String expResult = "<string>";
   String result = instance.getFileName();
   assertEquals(expResult, result);
 }
예제 #5
0
 /** Test of peek method, of class ReaderInput. */
 @org.junit.Test
 public void testPeek() {
   System.out.println("peek");
   char expResult = 'a';
   char result = instance.peek();
   assertEquals(expResult, result);
 }