KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jester > tests > MockMutationsList


1 package jester.tests;
2
3 import jester.MutationMaker;
4 import jester.MutationsList;
5
6 import com.mockobjects.ExpectationCounter;
7 import com.mockobjects.ExpectationList;
8
9 public class MockMutationsList implements MutationsList {
10     private ExpectationCounter myVisitCalls = new ExpectationCounter("jester.MutationsList VisitCalls");
11     private ExpectationList myVisitParameter0Values = new ExpectationList("jester.MutationsList VisitParameter0Values");
12     /**
13      * MockMutationsList constructor comment.
14      */

15     public MockMutationsList() {
16         super();
17     }
18     public void addExpectedVisitValues(MutationMaker arg0) {
19         myVisitParameter0Values.addExpected(arg0);
20     }
21     public void setExpectedVisitCalls(int calls) {
22         myVisitCalls.setExpected(calls);
23     }
24     public void verify() {
25         myVisitCalls.verify();
26         myVisitParameter0Values.verify();
27     }
28     public void visit(MutationMaker arg0) {
29         myVisitCalls.inc();
30         myVisitParameter0Values.addActual(arg0);
31     }
32 }
Popular Tags