goog.testing.MockControl
Provided By |
---|
Controls a set of mocks. Controlled mocks are replayed, verified, and cleaned-up at the same time.
new MockControl()
Parameters | None. |
---|
Instance Methods
this.$replayAll() → void
void
Calls replay on each controlled mock.
this.$resetAll() → void
void
Calls reset on each controlled mock.
this.$tearDown() → void
void
Calls tearDown on each controlled mock, if necesssary.
this.$verifyAll() → void
void
Calls verify on each controlled mock.
this.$waitAndVerifyAll() → goog.Promise<Array<undefined>, ?>
goog.Promise<Array<undefined>, ?>
Returns a Promise that resolves when all of the controlled mocks have finished and verified.
Parameters | None. | |
---|---|---|
Returns |
|
this.addMock( mock ) → (goog.testing.MockInterface|null)
(goog.testing.MockInterface|null)
Takes control of this mock.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
this.createConstructorMock( scope, constructorName, opt_strictness ) → goog.testing.MockInterface
goog.testing.MockInterface
Creates a controlled MethodMock for a constructor. Passes its arguments
through to the MethodMock constructor. See
goog.testing.createConstructorMock
for details.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
this.createFunctionMock( opt_functionName, opt_strictness ) → goog.testing.MockInterface
goog.testing.MockInterface
Creates a controlled FunctionMock. Passes its arguments through to the FunctionMock constructor.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
this.createGlobalFunctionMock( functionName, opt_strictness ) → goog.testing.MockInterface
goog.testing.MockInterface
Creates a controlled GlobalFunctionMock. Passes its arguments through to the GlobalFunctionMock constructor.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
this.createLooseMock( objectToMock, opt_ignoreUnexpectedCalls, opt_mockStaticMethods, opt_createProxy ) → goog.testing.LooseMock
goog.testing.LooseMock
Creates a controlled LooseMock. Passes its arguments through to the LooseMock constructor.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
this.createMethodMock( scope, functionName, opt_strictness ) → goog.testing.MockInterface
goog.testing.MockInterface
Creates a controlled MethodMock. Passes its arguments through to the MethodMock constructor.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
this.createStrictMock( objectToMock, opt_mockStaticMethods, opt_createProxy ) → goog.testing.StrictMock
goog.testing.StrictMock
Creates a controlled StrictMock. Passes its arguments through to the StrictMock constructor.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|