Package org.jmock.expectation
Class ExpectationMap
java.lang.Object
org.jmock.expectation.ExpectationMap
- All Implemented Interfaces:
Verifiable,Expectation
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExpected(Object key, Object value) voidaddExpectedMissing(Object key) booleanReturn true if any expectations have been set on this object.voidTell the object to expect nothing to happen to it, perhaps because the test is exercising the handling of an error.voidIf an incorrect actual value is set, defer reporting this as a failure until verify() is called on this object.voidverify()Throw an AssertionFailedException if any expectations have not been met.
-
Constructor Details
-
ExpectationMap
-
-
Method Details
-
addExpected
-
addExpectedMissing
-
get
-
hasExpectations
public boolean hasExpectations()Description copied from interface:ExpectationReturn true if any expectations have been set on this object.- Specified by:
hasExpectationsin interfaceExpectation
-
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
-
setFailOnVerify
public void setFailOnVerify()Description copied from interface:ExpectationIf an incorrect actual value is set, defer reporting this as a failure until verify() is called on this object.- Specified by:
setFailOnVerifyin interfaceExpectation
-
verify
public void verify()Description copied from interface:VerifiableThrow an AssertionFailedException if any expectations have not been met. Implementations of this method must be idempotent: jMock can call this method more than once when verifying expectations at the end of a test.- Specified by:
verifyin interfaceVerifiable
-