Class org.as2lib.test.mock.support.RecordState

Implemented Interfaces

MockControlState

Description

RecordState records behaviors.

Method Index

new RecordState()
getBehavior(), invokeMethod(), setArgumentsMatcher(), setMethodResponse(), verify()

Inherited from BasicClass

Constructor Detail

RecordState

public function RecordState(behavior:Behavior)

Constructs a new RecordState instance.

Parameters

behaviorthe behavior to add and get behaviors of the mock

Throws

IllegalArgumentExceptionif the passed-in behavior is null

Method Detail

getBehavior

public function getBehavior(Void):Behavior

Returns the behavior set during instantiation.

Return

the behavior

invokeMethod

public function invokeMethod(methodCall:MethodCall)

Adds the expected methodCall to the expected behavior of the mock.

Parameters

methodCallcontains all information about the method call

Specified By

invokeMethod() in org.as2lib.test.mock.MockControlState

setMethodResponse

public function setMethodResponse(methodResponse:MethodResponse, methodCallRange:MethodCallRange):Void

Sets the expectation that the lastly called method is called the passed-in number of times. When called between that range it responses the given way.

Parameters

methodResponsethe response of the method during the expected call range
methodCallRangethe expected range of method calls

Specified By

setMethodResponse() in org.as2lib.test.mock.MockControlState

setArgumentsMatcher

public function setArgumentsMatcher(argumentsMatcher:ArgumentsMatcher):Void

Sets the arguments matcher for the lastly called method.

The arguments matcher is used by the expected method call to check whether it matches an actual method call.

Parameters

argumentsMatcherthe new arguments matcher for the expected method call

Specified By

setArgumentsMatcher() in org.as2lib.test.mock.MockControlState

verify

public function verify(Void):Void