org.specs.mock

class inSequence

[source: org/specs/mock/inSequence.scala]

class inSequence(repetition : CallConstraint)
extends ProtocolType
The inSequence protocol type will try to consume expected calls in sequence. It will not consume unexpected calls.
It accepts a repetition parameter specifying how many expected calls are supposed to happen:
Direct Known Subclasses:
inSequence

Method Summary
def constraints : java.lang.String
def consume (exp : scala.List[SpecifiedCall], rec : scala.List[ReceivedCall]) : (scala.List[SpecifiedCall], scala.List[ReceivedCall])
Tries to match expected calls with received calls in sequence until the repetition parameter is satisfied.
Before doing so, it sets the repetition number on expected calls, so that they know when to stop matching received calls (especially for atLeast and atMost constraints).
If consumed received calls are not in the same order as their respective expected calls it resets them so that the received calls are not consumed and the expected calls are not passed
Methods inherited from ProtocolType
failures, expectedDefs, receivedMessages, equals
Methods inherited from AnyRef
getClass, hashCode, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
def constraints : java.lang.String
Returns
a String specifying the constraints of this protocol: e.g. "in sequence 2 of:". If it is exactly one, returns "in sequence"
Overrides
ProtocolType.constraints

def consume(exp : scala.List[SpecifiedCall], rec : scala.List[ReceivedCall]) : (scala.List[SpecifiedCall], scala.List[ReceivedCall])
Tries to match expected calls with received calls in sequence until the repetition parameter is satisfied.
Before doing so, it sets the repetition number on expected calls, so that they know when to stop matching received calls (especially for atLeast and atMost constraints).
If consumed received calls are not in the same order as their respective expected calls it resets them so that the received calls are not consumed and the expected calls are not passed
Returns
the list of expected calls and the list of received calls
Overrides
ProtocolType.consume


Copyright (c) 2007-2008. All Rights Reserved.