Class org.as2lib.test.mock.support.TypeArgumentsMatcher

Implemented Interfaces

ArgumentsMatcher

Description

TypeArgumentsMatcher matches the actual arguments agains a list of types.

Method Index

new TypeArgumentsMatcher()
matchArguments()

Inherited from BasicClass

Constructor Detail

TypeArgumentsMatcher

public function TypeArgumentsMatcher(expectedTypes:Array)

Constructs a new TypeArgumentsMatcher instance.

If a type in the expectedType array is null or undefined the expected and actual argument will be compared.

If an element in the expectedType array is an instance of type ArgumentMatcher, this argument matcher will be used to check whether the actual argument is correct.

Parameters

expectedTypesthe expected types of the arguments

Method Detail

matchArguments

public function matchArguments(expectedArguments:Array, actualArguments:Array):Boolean

Compares the actual arguments only by type against the expected types given on contruction.

If a type of the expected types is null or undefined the expected and actual argument will be compared directly with the strict equals operator.

false will be returned if:

  • The lengths of the expected and actual arguments differ.
  • The lengths of the expected types and the actual arguments differ.
  • Any actual argument is not of the expected type.

Parameters

actualArgumentsthe actual arguments

Specified By

matchArguments() in org.as2lib.test.mock.ArgumentsMatcher