Class org.as2lib.test.mock.MethodCall

org.as2lib.core.BasicClass
   +--org.as2lib.test.mock.MethodCall

Description

MethodCall stores all information available about a method call.

Method Index

new MethodCall()

getArguments(), getArgumentsMatcher(), getMethodName(), matches(), setArgumentsMatcher(), toString()

Constructor Detail

MethodCall

public function MethodCall(methodName:String, args:Array)

Constructs a new MethodCall instance.

If args is null an empty array will be used instead.

Parameters

methodNamethe name of the called method
argsthe arguments used for the method call

Method Detail

getMethodName

public function getMethodName(Void):String

Returns the name of the called method.

Return

the name of the called method

getArguments

public function getArguments(Void):Array

Returns the arguments used for the method call.

Return

the arguments used for the method call

getArgumentsMatcher

public function getArgumentsMatcher(Void):ArgumentsMatcher

Returns the currently used arguments matcher.

That is either the arguments matcher set via the setArgumentsMatcher method or an instance of the default DefaultArgumentsMatcher class.

Return

the currently used arguments matcher

setArgumentsMatcher

public function setArgumentsMatcher(argumentsMatcher:ArgumentsMatcher):Void

Sets the new arguments matcher.

If argumentsMatcher is null the getArgumentsMatcher method returns the default arguments matcher.

Parameters

argumentsMatcherthe new arguments matcher

matches

public function matches(methodCall:MethodCall):Boolean

Checks whether this method call matches the passed-in methodCall.

false will be returned if:

  • The passed-in methodCall is null.
  • The method names do not match.
  • The arguments do not match.

Parameters

methodCallthe method call to compare with this instance

toString

public function toString():String

Returns the string representation of this method call.

The returned string is constructed as follows:

   theMethodName(theFirstArgument, ..)
 

Return

the string representation of this method call

Specified By

toString() in org.as2lib.core.BasicInterface

Overrides

toString() in org.as2lib.core.BasicClass