goog.testing.Mock | |
goog.testing.LooseMock | goog.testing.Mock |
goog.testing.MockRange | goog.testing.LooseMock |
![]()
No description.
|
code » | ||
![]()
No description.
|
code » | ||
![]()
No description.
|
code » | ||
![]()
No description.
|
code » | ||
A setter for the ignoreUnexpectedCalls field.
Arguments:
Returns: !goog.testing.LooseMock
This mock object.
|
code » | ||
![]()
No description.
|
code » |
Allows the expectation to be called any number of times.
Returns: !goog.testing.Mock
This mock object.
|
code » | ||||
Render the provided argument array to a string to help
clients with debugging tests.
|
code » | ||||
Allows the expectation to be called any number of times, as long as it's
called once.
Returns: !goog.testing.Mock
This mock object.
|
code » | ||||
Allows the expectation to be called 0 or 1 times.
Returns: !goog.testing.Mock
This mock object.
|
code » | ||||
![]()
If this expectation defines a function to be called,
it will be called and its result will be returned.
Otherwise, if the expectation expects to throw, it will throw.
Otherwise, this method will return defined value.
Arguments:
Returns: *
The return value expected by the mock.
|
code » | ||||
Specifies a function to call for currently pending expectation.
Note, that using this method overrides declarations made
using $returns() and $throws() methods.
Arguments:
Returns: !goog.testing.Mock
This mock object.
|
code » | ||||
![]()
Initializes the functions on the mock object.
Arguments:
|
code » | ||||
![]()
If the expectation expects to throw, this method will throw.
Arguments:
|
code » | ||||
![]()
The function that replaces all methods on the mock object.
Arguments:
Returns: *
In record mode, returns the mock object. In replay mode, returns
whatever the creator of the mock set as the return value.
|
code » | ||||
Disallows the expectation from being called.
Returns: !goog.testing.Mock
This mock object.
|
code » | ||||
Allows the expectation to be called exactly once.
Returns: !goog.testing.Mock
This mock object.
|
code » | ||||
![]()
Throws an exception and records that an exception was thrown.
Arguments:
|
code » | ||||
![]()
Records an actual method call, intended to be overridden by a
subclass. The subclass must find the pending expectation and return the
correct value.
|
code » | ||||
![]()
Records the currently pending expectation, intended to be overridden by a
subclass.
|
code » | ||||
Registers a verfifier function to use when verifying method argument lists.
Arguments:
Returns: !goog.testing.Mock
This mock object.
|
code » | ||||
![]()
Switches from recording to replay mode.
|
code » | ||||
![]()
Resets the state of this mock object. This clears all pending expectations
without verifying, and puts the mock in recording mode.
|
code » | ||||
Specifies a return value for the currently pending expectation.
Arguments:
Returns: !goog.testing.Mock
This mock object.
|
code » | ||||
![]()
Throw an exception based on an incorrect method call.
|
code » | ||||
![]()
Throws an exception and records that an exception was thrown.
Arguments:
|
code » | ||||
Specifies a value for the currently pending expectation to throw.
Arguments:
Returns: !goog.testing.Mock
This mock object.
|
code » | ||||
Specifies the number of times the expectation should be called.
Arguments:
Returns: !goog.testing.Mock
This mock object.
|
code » | ||||
![]()
Verify that all of the expectations were met. Should be overridden by
subclasses.
|
code » | ||||
Verifies that a method call matches an expectation.
Arguments:
Returns: boolean
Whether the call matches the expectation.
|
code » |
![]()
No description.
|
Code » |
![]()
The calls that have been made; we cache them to verify at the end. Each
element is an array where the first element is the name, and the second
element is the arguments.
|
Code » | |
A map of method names to a LooseExpectationCollection for that method.
|
Code » | |
![]()
Whether to ignore unexpected calls.
|
Code » | |
![]()
No description.
|
Code » |
![]()
Map of argument name to optional argument list verifier function.
|
Code » | |
The expectation currently being created. All methods that modify the
current expectation return the Mock object for easy chaining, so this is
where we keep track of the expectation that's currently being modified.
|
Code » | |
![]()
A proxy for the mock. This can be used for dependency injection in lieu of
the mock if the test requires a strict instanceof check.
|
Code » | |
![]()
Whether or not we are in recording mode.
|
Code » | |
![]()
First exception thrown by this mock; used in $verify.
|
Code » |
![]()
No description.
|
Code » |