Skip to content

Commit

Permalink
Added MovieRepositoryImpl Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ashishrawat2911 committed Aug 5, 2022
1 parent 75288d0 commit 715840b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
7 changes: 2 additions & 5 deletions lib/data/source/local/movie_local_data_source.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@ class MovieLocalDataSourceImpl extends MovieLocalDataSource {

@override
Future<List<MovieEntity>> getMovies() async {
final movies = await _movieDao.findAllMovies();
return movies;
return _movieDao.findAllMovies();
}

@override
Future<MovieEntity?> movieDetails(int id) async {
final movie = await _movieDao.findMovieById(id);
if (movie == null) return null;
return movie;
return _movieDao.findMovieById(id);
}

@override
Expand Down
3 changes: 1 addition & 2 deletions lib/data/source/remote/movie_remote_data_source.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ class MovieRemoteDataSourceImpl extends MovieRemoteDataSource {

@override
Future<MovieResponseModel> getMovieDetails(int id) async {
final movie = await _movieApiService.getMovieDetails(id);
return movie;
return _movieApiService.getMovieDetails(id);
}

@override
Expand Down
1 change: 0 additions & 1 deletion test/data/repository/movie_repository_impl_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import 'movie_repository_impl_test.mocks.dart';
@GenerateMocks([MovieRepositoryImpl])
void main() {
MockMovieRepositoryImpl mockMovieRepository = MockMovieRepositoryImpl();

group('getPopularMovies function testing', () {
test('success test', () async {
const mockValue = Right<NetworkError, List<Movie>>([]);
Expand Down

0 comments on commit 715840b

Please sign in to comment.