Interface IMockInvocation

All Known Implementing Classes:
DelegatingMockInvocation, MockInvocation

public interface IMockInvocation
A method invocation on a mock object.
Author:
Peter Niederwieser
  • Method Summary

    Modifier and Type
    Method
    Description
    Delegates this method invocation to the real object underlying this mock object, including any method arguments.
    Delegates this method invocation to the real object underlying this mock object, replacing the original method arguments with the specified arguments.
    The arguments for the invocation.
    The invoked method.
    The mock object that received the invocation.
  • Method Details

    • getMockObject

      IMockObject getMockObject()
      The mock object that received the invocation.
    • getMethod

      IMockMethod getMethod()
      The invoked method.
    • getArguments

      List<Object> getArguments()
      The arguments for the invocation.
    • callRealMethod

      Object callRealMethod()
      Delegates this method invocation to the real object underlying this mock object, including any method arguments. If this mock object has no underlying real object, a CannotInvokeRealMethodException is thrown.
      Returns:
      the return value of the method to which this invocation was delegated
    • callRealMethodWithArgs

      Object callRealMethodWithArgs(Object... arguments)
      Delegates this method invocation to the real object underlying this mock object, replacing the original method arguments with the specified arguments. If this mock object has no underlying real object, a CannotInvokeRealMethodException is thrown.
      Returns:
      the return value of the method to which this invocation was delegated