Package com.mockobjects
Class AbstractExpectationCollection
- java.lang.Object
-
- com.mockobjects.AbstractExpectation
-
- com.mockobjects.AbstractExpectationCollection
-
- All Implemented Interfaces:
Expectation,ExpectationCollection,Verifiable
- Direct Known Subclasses:
ExpectationList,ExpectationSet
public abstract class AbstractExpectationCollection extends AbstractExpectation implements ExpectationCollection
-
-
Constructor Summary
Constructors Constructor Description AbstractExpectationCollection(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddActual(int actualItem)voidaddActual(java.lang.Object actualItem)voidaddActualMany(java.lang.Object[] items)voidaddActualMany(java.util.Enumeration items)voidaddActualMany(java.util.Iterator items)voidaddExpected(int expectedItem)voidaddExpected(java.lang.Object expectedItem)voidaddExpectedMany(java.lang.Object[] expectedItems)voidaddExpectedMany(java.util.Enumeration expectedItems)voidaddExpectedMany(java.util.Iterator expectedItems)voidclearActual()voidsetExpectNothing()Tell the object to expect nothing to happen to it, perhaps because the test is exercising the handling of an error.voidverify()Throw an AssertionFailedException if any expectations have not been met.-
Methods inherited from class com.mockobjects.AbstractExpectation
hasExpectations, setFailOnVerify
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.mockobjects.Expectation
hasExpectations, setFailOnVerify
-
-
-
-
Method Detail
-
addActual
public void addActual(java.lang.Object actualItem)
- Specified by:
addActualin interfaceExpectationCollection
-
addActual
public void addActual(int actualItem)
-
addActualMany
public void addActualMany(java.lang.Object[] items)
- Specified by:
addActualManyin interfaceExpectationCollection
-
addActualMany
public void addActualMany(java.util.Enumeration items)
- Specified by:
addActualManyin interfaceExpectationCollection
-
addActualMany
public void addActualMany(java.util.Iterator items)
- Specified by:
addActualManyin interfaceExpectationCollection
-
addExpected
public void addExpected(int expectedItem)
-
addExpected
public void addExpected(java.lang.Object expectedItem)
- Specified by:
addExpectedin interfaceExpectationCollection
-
addExpectedMany
public void addExpectedMany(java.lang.Object[] expectedItems)
- Specified by:
addExpectedManyin interfaceExpectationCollection
-
addExpectedMany
public void addExpectedMany(java.util.Enumeration expectedItems)
- Specified by:
addExpectedManyin interfaceExpectationCollection
-
addExpectedMany
public void addExpectedMany(java.util.Iterator expectedItems)
- Specified by:
addExpectedManyin interfaceExpectationCollection
-
clearActual
public void clearActual()
- Specified by:
clearActualin classAbstractExpectation
-
setExpectNothing
public void setExpectNothing()
Description copied from interface:ExpectationTell the object to expect nothing to happen to it, perhaps because the test is exercising the handling of an error. The Expectation will fail if any actual values are set. Note that this is not the same as not setting any expectations, in which case verify() will do nothing.- Specified by:
setExpectNothingin interfaceExpectation
-
verify
public void verify()
Description copied from interface:VerifiableThrow an AssertionFailedException if any expectations have not been met.- Specified by:
verifyin interfaceVerifiable- Specified by:
verifyin classAbstractExpectation
-
-