se.mockachino.order
Class BetweenVerifyContext

java.lang.Object
  extended by se.mockachino.order.BetweenVerifyContext

public class BetweenVerifyContext
extends java.lang.Object


Constructor Summary
BetweenVerifyContext(MockPoint start, MockPoint end)
           
 
Method Summary
 java.lang.Iterable<Invocation> getCalls(java.lang.Object mock)
           
 OrderingContext newOrdering()
          Creates a new ordering context which is used to verify method calls in order.
 VerifyRangeStart verifyAtLeast(int min)
          Verifies that a method call is called at least a specific number of times.
 VerifyRangeStart verifyAtMost(int max)
          Verifies that a method call is called at most a specific number of times.
 VerifyRangeStart verifyExactly(int count)
          Verifies that a method call is called an exact number of times.
 VerifyRangeStart verifyNever()
          Verifies that a method call is never called.
 VerifyRangeStart verifyOnce()
          Verifies that a method call is only called exactly once.
 VerifyRangeStart verifyRange(int min, int max)
          Verifies that a method call is called between min and max times, inclusive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BetweenVerifyContext

public BetweenVerifyContext(MockPoint start,
                            MockPoint end)
Method Detail

getCalls

public java.lang.Iterable<Invocation> getCalls(java.lang.Object mock)

verifyRange

public VerifyRangeStart verifyRange(int min,
                                    int max)
Verifies that a method call is called between min and max times, inclusive.

Typical usage:

 Mockachino.verifyRange(1, 2).on(mock).method();
 

Parameters:
min - minimum amount of matching method calls
max - maximum amount of matching method calls
Returns:
a verifier

verifyExactly

public VerifyRangeStart verifyExactly(int count)
Verifies that a method call is called an exact number of times.

Typical usage:

 Mockachino.verifyExactly(3).on(mock).method();
 

Parameters:
count - number of times the method should be called
Returns:
a verifier

verifyNever

public VerifyRangeStart verifyNever()
Verifies that a method call is never called.

Typical usage:

 Mockachino.verifyNever().on(mock).method();
 

Returns:
a verifier

verifyOnce

public VerifyRangeStart verifyOnce()
Verifies that a method call is only called exactly once.

Typical usage:

 Mockachino.verifyOnce().on(mock).method();
 

Returns:
a verifier

verifyAtLeast

public VerifyRangeStart verifyAtLeast(int min)
Verifies that a method call is called at least a specific number of times.

Typical usage:

 Mockachino.verifyAtLeast(3).on(mock).method();
 

Parameters:
min - number of times the method should be called
Returns:
a verifier

verifyAtMost

public VerifyRangeStart verifyAtMost(int max)
Verifies that a method call is called at most a specific number of times.

Typical usage:

 Mockachino.verifyAtMost(3).on(mock).method();
 

Parameters:
max - number of times the method should be called
Returns:
a verifier

newOrdering

public OrderingContext newOrdering()
Creates a new ordering context which is used to verify method calls in order. Ordering contexts are completely independent of each other.

Typical usage:

 OrderingContext context = Mockachino.newOrdering();
 context.verifyAtLeast(3).on(mock).method();
 

Returns:
the new ordering context