settings mock and database mock in test folder

main
Julian Gegner 2023-03-06 21:55:18 +01:00
parent 75b638b843
commit 716db5240f
3 changed files with 6 additions and 3 deletions

View File

@ -1,10 +1,8 @@
library app.globals; library app.globals;
import 'package:smoke_cess_app/mock/db_mock.dart';
import 'package:smoke_cess_app/services/database_service.dart'; import 'package:smoke_cess_app/services/database_service.dart';
DatabaseService databaseService = DatabaseMock(); DatabaseService databaseService = DatabaseService.instance;
// DatabaseService databaseService = DatabaseService.instance;
// set this to read settings from local json file instead of scanning a qr code // set this to read settings from local json file instead of scanning a qr code
bool useLocalConfig = false; bool useLocalConfig = false;

View File

@ -1,3 +1,5 @@
import 'package:shared_preferences/shared_preferences.dart';
Map<String, Object> mockSettings = { Map<String, Object> mockSettings = {
"group": 3, "group": 3,
"HITT_time": 35, "HITT_time": 35,
@ -15,3 +17,6 @@ Map<String, Object> mockSettings = {
}, },
"startedAt": DateTime.now().toIso8601String(), "startedAt": DateTime.now().toIso8601String(),
}; };
void mockSharedPreferences() =>
SharedPreferences.setMockInitialValues(mockSettings);