goog.testing.editor.FieldMock
Provided By | |
---|---|
Extends | |
All Implemented Interfaces |
Mock of goog.editor.Field.
new FieldMock( opt_window, opt_appWindow, opt_range )
Parameters |
|
---|
Instance Methods
this.$anyTimes() → goog.testing.Mock
goog.testing.Mock
Allows the expectation to be called any number of times.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.$argumentsAsString( args ) → string
string
this.$atLeastOnce() → goog.testing.Mock
goog.testing.Mock
Allows the expectation to be called any number of times, as long as it's called once.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.$atMostOnce() → goog.testing.Mock
goog.testing.Mock
Allows the expectation to be called 0 or 1 times.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.$do( expectation, args ) → *
*
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.
Defined by | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
| ||||||||
Returns |
|
this.$does( func ) → goog.testing.Mock
goog.testing.Mock
Specifies a function to call for currently pending expectation. Note, that using this method overrides declarations made using $returns() and $throws() methods.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.$maybeThrow( expectation ) → void
void
If the expectation expects to throw, this method will throw.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.$mockMethod( name ) → *
*
The function that replaces all methods on the mock object.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.$never() → goog.testing.Mock
goog.testing.Mock
Disallows the expectation from being called.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.$once() → goog.testing.Mock
goog.testing.Mock
Allows the expectation to be called exactly once.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.$recordAndThrow( ex, rethrow ) → void
void
Throws an exception and records that an exception was thrown.
Defined by | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
| ||||||||
Throws |
|
this.$recordCall( name, args ) → *
*
Records an actual method call, intended to be overridden by a subclass. The subclass must find the pending expectation and return the correct value.
Defined by | |||||||||
---|---|---|---|---|---|---|---|---|---|
Overrides | |||||||||
Parameters |
| ||||||||
Returns |
|
this.$recordExpectation() → void
void
Records the currently pending expectation, intended to be overridden by a subclass.
Defined by | |
---|---|
Overrides | |
Parameters | None. |
this.$registerArgumentListVerifier( methodName, fn ) → goog.testing.Mock
goog.testing.Mock
Registers a verifier function to use when verifying method argument lists.
Defined by | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
| ||||||||
Returns |
|
this.$replay() → void
void
Write down all the expected functions that have been called on the mock so far. From here on out, future function calls will be compared against this list.
Overrides | |
---|---|
Specified by | |
Parameters | None. |
this.$reset() → void
void
Reset the mock.
Overrides | |
---|---|
Specified by | |
Parameters | None. |
this.$returns( val ) → goog.testing.Mock
goog.testing.Mock
Specifies a return value for the currently pending expectation.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.$setIgnoreUnexpectedCalls( ignoreUnexpectedCalls ) → goog.testing.LooseMock
goog.testing.LooseMock
A setter for the ignoreUnexpectedCalls field.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.$throwCallException( name, args, opt_expectation ) → void
void
Throw an exception based on an incorrect method call.
Defined by | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
this.$throwException( comment, opt_message ) → void
void
this.$throws( val ) → goog.testing.Mock
goog.testing.Mock
Specifies a value for the currently pending expectation to throw.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.$times( times ) → goog.testing.Mock
goog.testing.Mock
Specifies the number of times the expectation should be called.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.$verify() → void
void
Assert that the expected function calls match the actual calls.
Overrides | |
---|---|
Specified by | |
Parameters | None. |
this.$verifyCall( expectation, name, args ) → boolean
boolean
Verifies that a method call matches an expectation.
Defined by | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
| ||||||||||||
Returns |
|
this.$waitAndVerify() → goog.Promise<undefined, ?>
goog.Promise<undefined, ?>
Waits for the Mock to gather expectations and then performs verify.
Overrides | ||
---|---|---|
Specified by | ||
Parameters | None. | |
Returns |
|
this.inModalMode() → boolean
boolean
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.isUneditable() → boolean
boolean
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.setModalMode( mode ) → void
void
Parameters |
|
---|
this.setUneditable( isUneditable ) → void
void
Parameters |
|
---|
Instance Properties
this.$argumentListVerifiers_ → (Object|null)
(Object|null)
Map of argument name to optional argument list verifier function.
this.$pendingExpectation → (goog.testing.MockExpectation|null)
(goog.testing.MockExpectation|null)
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.
this.$proxy → (Object|null)
(Object|null)
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.
this.waitingForExpectations → (goog.promise.Resolver<undefined>|null)
(goog.promise.Resolver<undefined>|null)
No information.