From 049d0c7690387c5cadaee71fc5b4e8ba08c5762e Mon Sep 17 00:00:00 2001 From: Vadim <44135514+vodemn@users.noreply.github.com> Date: Fri, 20 Oct 2023 09:18:44 +0200 Subject: [PATCH] added storage action verification for `FilmsProvider` tests --- test/providers/films_provider_test.dart | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/providers/films_provider_test.dart b/test/providers/films_provider_test.dart index 0294379..760ca43 100644 --- a/test/providers/films_provider_test.dart +++ b/test/providers/films_provider_test.dart @@ -110,6 +110,9 @@ void main() { expectFilmsCount(mockFilms.length + 1); expectFilmsInUseCount(mockFilms.length + 1); expectSelectedFilmName(''); + + verify(() => mockIAPStorageService.filmsInUse = mockFilms.skip(0).toList()).called(1); + verifyNever(() => mockIAPStorageService.selectedFilm = const Film.other()); }, ); @@ -131,6 +134,9 @@ void main() { expectFilmsCount(mockFilms.length + 1); expectFilmsInUseCount(mockFilms.length + 1); expectSelectedFilmName(mockFilms.first.name); + + verifyNever(() => mockIAPStorageService.filmsInUse = any>()); + verify(() => mockIAPStorageService.selectedFilm = mockFilms.first).called(1); }, ); @@ -148,6 +154,7 @@ void main() { expectFilmsInUseCount(1); expectSelectedFilmName(''); + verifyNever(() => mockIAPStorageService.filmsInUse = any>()); verify(() => mockIAPStorageService.selectedFilm = const Film.other()).called(1); }, ); @@ -163,6 +170,7 @@ void main() { expectFilmsInUseCount(1); expectSelectedFilmName(''); + verifyNever(() => mockIAPStorageService.filmsInUse = any>()); verifyNever(() => mockIAPStorageService.selectedFilm = const Film.other()); }, ); @@ -187,6 +195,9 @@ void main() { expectFilmsCount(mockFilms.length + 1); expectFilmsInUseCount((mockFilms.length - 1) + 1); expectSelectedFilmName(''); + + verify(() => mockIAPStorageService.filmsInUse = mockFilms.skip(1).toList()).called(1); + verify(() => mockIAPStorageService.selectedFilm = const Film.other()).called(1); }, ); },