01: /*
02: * Copyright (C) Chaperon. All rights reserved.
03: * -------------------------------------------------------------------------
04: * This software is published under the terms of the Apache Software License
05: * version 1.1, a copy of which has been included with this distribution in
06: * the LICENSE file.
07: */
08:
09: 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: public SortedCharSetTestCase(String name) {
19: super (name);
20: }
21:
22: public void testCharSet() {
23: SortedCharSet set = new SortedCharSet();
24:
25: set.addChar('A');
26: set.addChar('Z');
27: set.addChar('%');
28: set.addChar('a');
29: set.addChar('%');
30: set.addChar('z');
31:
32: assertEquals("Test count of chars", 5, set.getCharCount());
33:
34: assertEquals("Test char", '%', set.getChar(0));
35: assertEquals("Test char", 'A', set.getChar(1));
36: assertEquals("Test char", 'Z', set.getChar(2));
37: assertEquals("Test char", 'a', set.getChar(3));
38: assertEquals("Test char", 'z', set.getChar(4));
39: }
40:
41: public static Test suite() {
42: return new TestSuite(SortedCharSetTestCase.class);
43: }
44: }
|