# Class goog.testing.MockExpectation

code »

This is a class that represents an expectation.

## Constructor

goog.testing.MockExpectation ( name )

Parameters

name: `string`
  The name of the method for this expectation.

Show:Public Protected Private

## Instance Methods

code »addErrorMessage ( message )

Allow expectation failures to include messages.

Parameters

message: `string`
  The failure message.

code »getErrorMessage ( ) ⇒ `string`

Get the error messages seen so far.

Returns

Error messages separated by \n.

code »getErrorMessageCount ( ) ⇒ `number`

Get how many error messages have been seen so far.

Returns

Count of error messages.

## Instance Properties

code »actualCalls : `number`

The number of times this method is called by real code.

code »argumentList : `Array`

The arguments that are expected to be passed to this function

code »errorMessages : `Array`

An array of error messages for expectations not met.

code »exceptionToThrow : `*`

The value that will be thrown when the method is called

code »maxCalls : `number`

The maximum number of times this method should be called.

code »minCalls : `number`

The minimum number of times this method should be called.

code »name : `string`

The name of the method that is expected to be called.

code »returnValue : `*`

The value that this method should return.

code »toDo : `Function`

The function which will be executed when this method is called. Method arguments will be passed to this function, and return value of this function will be returned by the method.

code »verificationCalls : `number`

The number of times this method is called during the verification phase.