01: package uk.co.jezuk.mango;
02:
03: import junit.framework.*;
04:
05: public class SingletonIteratorTest extends TestCase {
06: public SingletonIteratorTest(String name) {
07: super (name);
08: }
09:
10: public static Test suite() {
11: return new TestSuite(SingletonIteratorTest.class);
12: }
13:
14: public void test1() {
15: java.util.Iterator i = Iterators.SingletonIterator(new String(
16: "one"));
17: assertEquals(true, i.hasNext());
18: assertEquals("one", i.next());
19: assertEquals(false, i.hasNext());
20: } // test1
21:
22: public void test2() {
23: java.util.Iterator i = Iterators.SingletonIterator(null);
24: assertEquals(false, i.hasNext());
25: } // test2
26: } // SingletonIteratorTest
|