Behavior
DefaultBehavior stores expected behaviors and exposes them for
verification.
public function getMethodBehaviorFactory(Void):MethodBehaviorFactoryReturns either the factory set via setMethodBehaviorFactory or the default one which returns an instance of class DefaultMethodBehavior.
the currently used factory to obtain method call behaviors
public function setMethodBehaviorFactory(methodBehaviorFactory:MethodBehaviorFactory):VoidSets the factory used to obtain method call behaviors to store state.
If methodBehaviorFactory is null the
getMethodBehaviorFactory method will return the default factory.
methodBehaviorFactory | the new factory |
public function addMethodBehavior(methodName:String, methodBehavior:MethodBehavior):Void
Adds the given methodBehavior behavior for the passed-in
methodName.
If the passed-in methodName is null or an empty string the one
returned by the method behaviour's expected method call will be used. If this
is also null or an empty string "[unknown]" will be used.
| IllegalArgumentException | if the passed-in methodBehavior is
null
|
public function createMethodBehavior(expectedMethodCall:MethodCall):MethodBehavior
Creates a new method behavior for the passed-in expectedMethodCall.
expectedMethodCall | the method call to create a behavior for |
the created method behavior
createMethodBehavior() in org.as2lib.test.mock.Behavior
public function getMethodBehavior(actualMethodCall:MethodCall):MethodBehavior
Returns a method behavior that matches the given actualMethodCall.
null will be returned if:
actualMethodCall is null.a matching method behavior
public function getLastMethodBehavior(Void):MethodBehaviorReturns the lastly added method behavior.
the lastly added method behavior