The goog.testing.MockExpectation Class

goog.testing.MockExpectation(name)

This is a class that represents an expectation.

name {string}
The name of the method for this expectation.

.actualCalls {number}

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

.addErrorMessage(message)

Allow expectation failures to include messages.

message {string}
The failure message.

.argumentList {Array.<*>}

The arguments that are expected to be passed to this function

.errorMessages {Array}

An array of error messages for expectations not met.

.exceptionToThrow {*}

The value that will be thrown when the method is called

.getErrorMessage()

Get the error messages seen so far.

returns {string}
Error messages separated by \n.

.getErrorMessageCount()

Get how many error messages have been seen so far.

returns {number}
Count of error messages.

.maxCalls {number}

The maximum number of times this method should be called.

.minCalls {number}

The minimum number of times this method should be called.

.name {string}

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

.returnValue {*}

The value that this method should return.

.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.

.verificationCalls {number}

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