1 package org.paneris.jammyjoes.mvp;
2
3 import java.util.Collection;
4 import java.util.LinkedList;
5
6 import junit.framework.TestCase;
7
8 import com.mockobjects.dynamic.Mock;
9
10 public class VisitableCollectionAdaptorTest extends TestCase {
11
12 public void testVisitableCollectionAdaptor() {
13 Object expected = new Object();
14 Collection list = new LinkedList();
15 list.add(expected);
16 Selection unit = new VisitableCollectionAdaptor(list);
17
18 Mock commandController = new Mock(Command.class);
19 commandController.expect("visit", expected);
20
21 unit.visitEach((Command)commandController.proxy());
22
23 commandController.verify();
24
25 }
26 }