com.hammingweight.hammock
Class DefaultArgumentMatcher

java.lang.Object
  extended by com.hammingweight.hammock.DefaultArgumentMatcher
All Implemented Interfaces:
IArgumentMatcher

public class DefaultArgumentMatcher
extends java.lang.Object
implements IArgumentMatcher

The DefaultArgumentMatcher is used by default by the MethodHandler class to determine whether a method was invoked with the expected arguments. This IArgumentMatcher is used unless no argument expectations were set, an argument is ignored or a proprietary IArgumentMatcher has been set for the method argument.

Since:
Hammock 1.4
Author:
C.A. Meijer

Constructor Summary
DefaultArgumentMatcher()
           
 
Method Summary
 boolean areArgumentsEqual(java.lang.Object argumentExpected, java.lang.Object argumentActual)
          A method to determine whether an argument passed in a method invocation of a mock object is equal to the expected argument.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultArgumentMatcher

public DefaultArgumentMatcher()
Method Detail

areArgumentsEqual

public boolean areArgumentsEqual(java.lang.Object argumentExpected,
                                 java.lang.Object argumentActual)
Description copied from interface: IArgumentMatcher
A method to determine whether an argument passed in a method invocation of a mock object is equal to the expected argument.

Specified by:
areArgumentsEqual in interface IArgumentMatcher
Parameters:
argumentExpected - The expected argument.
argumentActual - The argument that was actually passed to a method.
Returns:
Returns true if argumentExpected.equals(argumentActual) returns true, or both arguments are null, or both arguments are arrays that contain the same elements; otherwise false.