From 5672440837ad0fb4940d89cdcb1b576dd2e85909 Mon Sep 17 00:00:00 2001 From: Vadim Date: Mon, 10 Jul 2023 17:41:36 +0200 Subject: [PATCH] `MeteringInteractor` tests (wip) --- .../interactors/metering_interactor_test.dart | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/test/interactors/metering_interactor_test.dart b/test/interactors/metering_interactor_test.dart index e4ec325..bd6a169 100644 --- a/test/interactors/metering_interactor_test.dart +++ b/test/interactors/metering_interactor_test.dart @@ -105,11 +105,12 @@ void main() { verify(() => mockUserPreferencesService.iso).called(1); }); - // test('iso - set', () async { - // when(() => mockUserPreferencesService.iso = IsoValue.values.first); - // interactor.iso = IsoValue.values.first; - // verify(() => mockUserPreferencesService.iso = IsoValue.values.first).called(1); - // }); + test('iso - set', () async { + when(() => mockUserPreferencesService.iso = IsoValue.values.first) + .thenReturn(IsoValue.values.first); + interactor.iso = IsoValue.values.first; + verify(() => mockUserPreferencesService.iso = IsoValue.values.first).called(1); + }); test('ndFilter - get', () async { when(() => mockUserPreferencesService.ndFilter).thenReturn(NdValue.values.first); @@ -117,11 +118,12 @@ void main() { verify(() => mockUserPreferencesService.ndFilter).called(1); }); - // test('ndFilter - set', () async { - // when(() => mockUserPreferencesService.ndFilter = NdValue.values.first); - // interactor.ndFilter = NdValue.values.first; - // verify(() => mockUserPreferencesService.ndFilter = NdValue.values.first).called(1); - // }); + test('ndFilter - set', () async { + when(() => mockUserPreferencesService.ndFilter = NdValue.values.first) + .thenReturn(NdValue.values.first); + interactor.ndFilter = NdValue.values.first; + verify(() => mockUserPreferencesService.ndFilter = NdValue.values.first).called(1); + }); test('film - get', () async { when(() => mockUserPreferencesService.film).thenReturn(Film.values.first); @@ -129,11 +131,12 @@ void main() { verify(() => mockUserPreferencesService.film).called(1); }); - // test('film - set', () async { - // when(() => mockUserPreferencesService.film = Film.values.first); - // interactor.film = Film.values.first; - // verify(() => mockUserPreferencesService.film = Film.values.first).called(1); - // }); + test('film - set', () async { + when(() => mockUserPreferencesService.film = Film.values.first) + .thenReturn(Film.values.first); + interactor.film = Film.values.first; + verify(() => mockUserPreferencesService.film = Film.values.first).called(1); + }); }, );