-
-
Notifications
You must be signed in to change notification settings - Fork 155
Closed
Description
Instead of writing:
if(testing){
GetIt.I.unregister<BlueToothService>();
GetIt.I.registerLazySingleton<BlueToothService>(() => BlueToothServiceMock());
GetIt.I.unregister<PurchasesManager>();
GetIt.I.registerLazySingleton<PurchasesManager>(() => PurchasesManagerMock());
}
It would be nice to write:
if(testing){
GetIt.I.replace<BlueToothService>(() => BlueToothServiceMock());
GetIt.I.replace<PurchasesManager>(() => PurchasesManagerMock());
}
Maybe there is something for this already and I'm just missing it? I tried resetLazySingleton
but it didn't work as I expected.