@@ -47,71 +47,73 @@ void main() {
47
47
check (await db.getGlobalSettings ()).themeSetting.equals (ThemeSetting .dark);
48
48
});
49
49
50
- test ('BoolGlobalSettings get ignores unknown names' , () async {
51
- await db.into (db.boolGlobalSettings)
52
- .insert (BoolGlobalSettingRow (name: 'nonsense' , value: true ));
53
- check (await db.getBoolGlobalSettings ()).isEmpty ();
54
-
55
- final setting = BoolGlobalSetting .placeholderIgnore;
56
- await db.into (db.boolGlobalSettings)
57
- .insert (BoolGlobalSettingRow (name: setting.name, value: true ));
58
- check (await db.getBoolGlobalSettings ())
59
- .deepEquals ({setting: true });
60
- });
50
+ group ('BoolGlobalSettings' , () {
51
+ test ('get ignores unknown names' , () async {
52
+ await db.into (db.boolGlobalSettings)
53
+ .insert (BoolGlobalSettingRow (name: 'nonsense' , value: true ));
54
+ check (await db.getBoolGlobalSettings ()).isEmpty ();
55
+
56
+ final setting = BoolGlobalSetting .placeholderIgnore;
57
+ await db.into (db.boolGlobalSettings)
58
+ .insert (BoolGlobalSettingRow (name: setting.name, value: true ));
59
+ check (await db.getBoolGlobalSettings ())
60
+ .deepEquals ({setting: true });
61
+ });
61
62
62
- test ('BoolGlobalSettings insert, then get' , () async {
63
- check (await db.getBoolGlobalSettings ()).isEmpty ();
63
+ test ('insert, then get' , () async {
64
+ check (await db.getBoolGlobalSettings ()).isEmpty ();
64
65
65
- // As in doSetBoolGlobalSetting for `value` non-null.
66
- final setting = BoolGlobalSetting .placeholderIgnore;
67
- await db.into (db.boolGlobalSettings).insertOnConflictUpdate (
68
- BoolGlobalSettingRow (name: setting.name, value: true ));
69
- check (await db.getBoolGlobalSettings ())
70
- .deepEquals ({setting: true });
71
- check (await db.select (db.boolGlobalSettings).get ()).length.equals (1 );
72
- });
66
+ // As in doSetBoolGlobalSetting for `value` non-null.
67
+ final setting = BoolGlobalSetting .placeholderIgnore;
68
+ await db.into (db.boolGlobalSettings).insertOnConflictUpdate (
69
+ BoolGlobalSettingRow (name: setting.name, value: true ));
70
+ check (await db.getBoolGlobalSettings ())
71
+ .deepEquals ({setting: true });
72
+ check (await db.select (db.boolGlobalSettings).get ()).length.equals (1 );
73
+ });
73
74
74
- test ('BoolGlobalSettings delete, then get' , () async {
75
- final setting = BoolGlobalSetting .placeholderIgnore;
76
- await db.into (db.boolGlobalSettings).insertOnConflictUpdate (
77
- BoolGlobalSettingRow (name: setting.name, value: true ));
78
- check (await db.getBoolGlobalSettings ())
79
- .deepEquals ({setting: true });
80
-
81
- // As in doSetBoolGlobalSetting for `value` null.
82
- final query = db.delete (db.boolGlobalSettings)
83
- ..where ((r) => r.name.equals (setting.name));
84
- await query.go ();
85
- check (await db.getBoolGlobalSettings ()).isEmpty ();
86
- check (await db.select (db.boolGlobalSettings).get ()).isEmpty ();
87
- });
75
+ test ('delete, then get' , () async {
76
+ final setting = BoolGlobalSetting .placeholderIgnore;
77
+ await db.into (db.boolGlobalSettings).insertOnConflictUpdate (
78
+ BoolGlobalSettingRow (name: setting.name, value: true ));
79
+ check (await db.getBoolGlobalSettings ())
80
+ .deepEquals ({setting: true });
81
+
82
+ // As in doSetBoolGlobalSetting for `value` null.
83
+ final query = db.delete (db.boolGlobalSettings)
84
+ ..where ((r) => r.name.equals (setting.name));
85
+ await query.go ();
86
+ check (await db.getBoolGlobalSettings ()).isEmpty ();
87
+ check (await db.select (db.boolGlobalSettings).get ()).isEmpty ();
88
+ });
88
89
89
- test ('BoolGlobalSettings insert replaces' , () async {
90
- final setting = BoolGlobalSetting .placeholderIgnore;
91
- await db.into (db.boolGlobalSettings).insertOnConflictUpdate (
92
- BoolGlobalSettingRow (name: setting.name, value: true ));
93
- check (await db.getBoolGlobalSettings ())
94
- .deepEquals ({setting: true });
95
-
96
- // As in doSetBoolGlobalSetting for `value` non-null.
97
- await db.into (db.boolGlobalSettings).insertOnConflictUpdate (
98
- BoolGlobalSettingRow (name: setting.name, value: false ));
99
- check (await db.getBoolGlobalSettings ())
100
- .deepEquals ({setting: false });
101
- check (await db.select (db.boolGlobalSettings).get ()).length.equals (1 );
102
- });
90
+ test ('insert replaces' , () async {
91
+ final setting = BoolGlobalSetting .placeholderIgnore;
92
+ await db.into (db.boolGlobalSettings).insertOnConflictUpdate (
93
+ BoolGlobalSettingRow (name: setting.name, value: true ));
94
+ check (await db.getBoolGlobalSettings ())
95
+ .deepEquals ({setting: true });
96
+
97
+ // As in doSetBoolGlobalSetting for `value` non-null.
98
+ await db.into (db.boolGlobalSettings).insertOnConflictUpdate (
99
+ BoolGlobalSettingRow (name: setting.name, value: false ));
100
+ check (await db.getBoolGlobalSettings ())
101
+ .deepEquals ({setting: false });
102
+ check (await db.select (db.boolGlobalSettings).get ()).length.equals (1 );
103
+ });
103
104
104
- test ('BoolGlobalSettings delete is idempotent' , () async {
105
- check (await db.getBoolGlobalSettings ()).isEmpty ();
106
-
107
- // As in doSetBoolGlobalSetting for `value` null.
108
- final setting = BoolGlobalSetting .placeholderIgnore;
109
- final query = db.delete (db.boolGlobalSettings)
110
- ..where ((r) => r.name.equals (setting.name));
111
- await query.go ();
112
- // (No error occurred, even though there was nothing to delete.)
113
- check (await db.getBoolGlobalSettings ()).isEmpty ();
114
- check (await db.select (db.boolGlobalSettings).get ()).isEmpty ();
105
+ test ('delete is idempotent' , () async {
106
+ check (await db.getBoolGlobalSettings ()).isEmpty ();
107
+
108
+ // As in doSetBoolGlobalSetting for `value` null.
109
+ final setting = BoolGlobalSetting .placeholderIgnore;
110
+ final query = db.delete (db.boolGlobalSettings)
111
+ ..where ((r) => r.name.equals (setting.name));
112
+ await query.go ();
113
+ // (No error occurred, even though there was nothing to delete.)
114
+ check (await db.getBoolGlobalSettings ()).isEmpty ();
115
+ check (await db.select (db.boolGlobalSettings).get ()).isEmpty ();
116
+ });
115
117
});
116
118
117
119
test ('create account' , () async {
0 commit comments