addTest<MInstance extends MvvmInstance> method
void
addTest<MInstance extends MvvmInstance>({
- String scope = BaseScopes.global,
- required MvvmInstance instance,
- dynamic params,
- bool overrideMainInstance = true,
Adds test instance for given instance type
Used only for tests
scope
- string scope value
instance
- given instance to add
params
- params for this instance
Implementation
@visibleForTesting
void addTest<MInstance extends MvvmInstance>({
String scope = BaseScopes.global,
required MvvmInstance instance,
dynamic params,
bool overrideMainInstance = true,
}) {
final id = MInstance.toString();
container.addObjectInScope(
object: instance,
type: id,
scopeId: scope,
overrideMainInstance: overrideMainInstance,
);
if (!instance.isInitialized) {
instance.initialize(params);
}
}