goog.testing.MockControl
Classgoog.testing.MockControl()
Controls a set of mocks. Controlled mocks are replayed, verified, and cleaned-up at the same time.
.$replayAll()
Calls replay on each controlled mock.
.$resetAll()
Calls reset on each controlled mock.
.$tearDown()
Calls tearDown on each controlled mock, if necesssary.
.$verifyAll()
Calls verify on each controlled mock.
.addMock(mock)
Takes control of this mock.
mock
{goog.testing.MockInterface
}
goog.testing.MockInterface
}
.createConstructorMock(scope, constructorName, opt_strictness)
Creates a controlled MethodMock for a constructor. Passes its arguments through to the MethodMock constructor. See {@link goog.testing.createConstructorMock} for details.
scope
{Object
}
constructorName
{string
}
opt_strictness
{number
=}
goog.testing.MockInterface
}
.createFunctionMock(opt_functionName, opt_strictness)
Creates a controlled FunctionMock. Passes its arguments through to the FunctionMock constructor.
opt_functionName
{string
=}
opt_strictness
{number
=}
goog.testing.MockInterface
}
.createGlobalFunctionMock(functionName, opt_strictness)
Creates a controlled GlobalFunctionMock. Passes its arguments through to the GlobalFunctionMock constructor.
functionName
{string
}
opt_strictness
{number
=}
goog.testing.MockInterface
}
.createLooseMock(objectToMock, opt_ignoreUnexpectedCalls, opt_mockStaticMethods,
opt_createProxy)
Creates a controlled LooseMock. Passes its arguments through to the LooseMock constructor.
objectToMock
{Object
}
opt_ignoreUnexpectedCalls
{boolean
=}
opt_mockStaticMethods
{boolean
=}
opt_createProxy
{boolean
=}
goog.testing.LooseMock
}
.createMethodMock(scope, functionName, opt_strictness)
Creates a controlled MethodMock. Passes its arguments through to the MethodMock constructor.
scope
{Object
}
functionName
{string
}
opt_strictness
{number
=}
goog.testing.MockInterface
}
.createStrictMock(objectToMock, opt_mockStaticMethods, opt_createProxy)
Creates a controlled StrictMock. Passes its arguments through to the StrictMock constructor.
objectToMock
{Object
}
opt_mockStaticMethods
{boolean
=}
opt_createProxy
{boolean
=}
goog.testing.StrictMock
}