com.agical.rmock.core.match.multiplicity
Class MultiplicityFactory

java.lang.Object
  extended by com.agical.rmock.core.match.multiplicity.MultiplicityFactory

public class MultiplicityFactory
extends java.lang.Object

(c) Agical AB 2005

Author:
joakim.ohlrogge

Nested Class Summary
 class MultiplicityFactory.LimitableMultiplicity
          Extends the multiplicity with a to method, limiting the current multiplicitys max matches.
 
Constructor Summary
MultiplicityFactory()
           
 
Method Summary
 Multiplicity atLeast(int min)
           
 Multiplicity atLeastOnce()
           
 Multiplicity atMost(int times)
          Creates a constraint that can match up to a specified times 0..times
 Multiplicity atMostOnce()
          Creates a constraint that can match up to one times 0..*
 Multiplicity exactly(int times)
           
 MultiplicityFactory.LimitableMultiplicity from(int min)
          Use this methd to specify ranges.
 Multiplicity once()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiplicityFactory

public MultiplicityFactory()
Method Detail

once

public Multiplicity once()
Returns:
a once multiplicity constraint

atLeastOnce

public Multiplicity atLeastOnce()
Returns:
at least once multiplicity constraint

atLeast

public Multiplicity atLeast(int min)
Parameters:
min - the minimum number of times the method is expected to be called.
Returns:
an at least <min> times

exactly

public Multiplicity exactly(int times)
Parameters:
times - the exact number of times the method is expected to be called.
Returns:
an <exact> number of times constraint.

atMost

public Multiplicity atMost(int times)
Creates a constraint that can match up to a specified times 0..times

Parameters:
times - the maximum number of times the method is expected to be called.
Returns:
an <at most> number of times constraint.

atMostOnce

public Multiplicity atMostOnce()
Creates a constraint that can match up to one times 0..*

Returns:
an <at most once> constraint

from

public MultiplicityFactory.LimitableMultiplicity from(int min)
Use this methd to specify ranges. This method returns an X..* multiplicity with an optional max-limitation via the to(Y) method on the returned Multiplicity

Returns:


Copyright © 2005-2010 Agical AB. All Rights Reserved.