This commit is contained in:
Vadim 2023-06-23 10:42:07 +02:00
parent 80fe288bd0
commit 34da381b11

View file

@ -164,6 +164,25 @@ void main() {
}); });
}); });
group('stopType', () {
test('get default', () {
when(() => sharedPreferences.getInt(UserPreferencesService.stopTypeKey)).thenReturn(null);
expect(service.stopType, StopType.third);
});
test('get', () {
when(() => sharedPreferences.getInt(UserPreferencesService.stopTypeKey)).thenReturn(1);
expect(service.stopType, StopType.half);
});
test('set', () {
when(() => sharedPreferences.setInt(UserPreferencesService.stopTypeKey, 0))
.thenAnswer((_) => Future.value(true));
service.stopType = StopType.full;
verify(() => sharedPreferences.setInt(UserPreferencesService.stopTypeKey, 0)).called(1);
});
});
group('meteringScreenLayout', () { group('meteringScreenLayout', () {
test('get default', () { test('get default', () {
when( when(