test.jmock.core.testsupport
Class MockConstraint
java.lang.Object
junit.framework.Assert
test.jmock.core.testsupport.MockConstraint
- All Implemented Interfaces:
- Constraint, SelfDescribing, Verifiable
- public class MockConstraint
- extends Assert
- implements Constraint, Verifiable
Method Summary |
StringBuffer |
describeTo(StringBuffer buffer)
Appends the description of this object to the buffer. |
boolean |
eval(Object arg)
Evaluates the constraint for argument o. |
void |
verify()
Throw an AssertionFailedException if any expectations have not been met. |
Methods inherited from class junit.framework.Assert |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MockConstraint
public MockConstraint(String description)
MockConstraint
public MockConstraint(String description,
Object expectedArg,
boolean result)
describeTo
public StringBuffer describeTo(StringBuffer buffer)
- Description copied from interface:
SelfDescribing
- Appends the description of this object to the buffer.
- Specified by:
describeTo
in interface SelfDescribing
- Parameters:
buffer
- The buffer that the description is appended to.
- Returns:
- The buffer passed to the invokedMethod.
eval
public boolean eval(Object arg)
- Description copied from interface:
Constraint
- Evaluates the constraint for argument o.
- Specified by:
eval
in interface Constraint
- Parameters:
arg
- the object against which the constraint is evaluated.
- Returns:
true
if o meets the constraint,
false
if it does not.
verify
public void verify()
- Description copied from interface:
Verifiable
- Throw an AssertionFailedException if any expectations have not been met.
- Specified by:
verify
in interface Verifiable