LCOV - code coverage report
Current view: top level - lib/domain/usecases/fil_actualite - get_posts.dart (source / functions) Hit Total Coverage
Test: lcov.info Lines: 4 4 100.0 %
Date: 2020-06-26 11:36:11 Functions: 0 0 -

          Line data    Source code
       1             : import 'package:app_pym/domain/entities/app_pym/post.dart';
       2             : import 'package:app_pym/domain/repositories/app_pym/post_repository.dart';
       3             : import 'package:injectable/injectable.dart';
       4             : 
       5             : import '../../../core/usecases/usecase.dart';
       6             : 
       7             : @prod
       8             : @lazySingleton
       9             : class GetPosts extends Usecase<Future<List<Post>>, NoParams> {
      10             :   final PostRepository repository;
      11             : 
      12           1 :   const GetPosts(this.repository);
      13             : 
      14             :   @override
      15           1 :   Future<List<Post>> call(NoParams _) async {
      16           3 :     final posts = await repository.fetchAll();
      17           1 :     posts.sort((a, b) => -a.published.compareTo(b.published));
      18             :     return posts;
      19             :   }
      20             : }

Generated by: LCOV version 1.13