1 8 9 package net.sourceforge.chaperon.test; 10 11 import junit.framework.Test; 12 import junit.framework.TestCase; 13 import junit.framework.TestSuite; 14 15 import net.sourceforge.chaperon.common.SortedCharSet; 16 17 public class SortedCharSetTestCase extends TestCase 18 { 19 public SortedCharSetTestCase(String name) 20 { 21 super(name); 22 } 23 24 public void testCharSet() 25 { 26 SortedCharSet set = new SortedCharSet(); 27 28 set.addChar('A'); 29 set.addChar('Z'); 30 set.addChar('%'); 31 set.addChar('a'); 32 set.addChar('%'); 33 set.addChar('z'); 34 35 assertEquals("Test count of chars", 5, set.getCharCount()); 36 37 assertEquals("Test char", '%', set.getChar(0)); 38 assertEquals("Test char", 'A', set.getChar(1)); 39 assertEquals("Test char", 'Z', set.getChar(2)); 40 assertEquals("Test char", 'a', set.getChar(3)); 41 assertEquals("Test char", 'z', set.getChar(4)); 42 } 43 44 public static Test suite() 45 { 46 return new TestSuite(SortedCharSetTestCase.class); 47 } 48 } 49 | Popular Tags |