LCOV - code coverage report
Current view: top level - home/model - home_repository.dart (source / functions) Hit Total Coverage
Test: SWE574 - Fall2023 - Group1 - Mobile Test Coverage Lines: 8 8 100.0 %
Date: 2023-12-31 10:28:05 Functions: 0 0 -
Legend: Lines: hit not hit

          Line data    Source code
       1             : import 'package:memories_app/network/network_manager.dart';
       2             : import 'package:memories_app/routes/home/model/response/stories_response_model.dart';
       3             : import 'package:memories_app/util/api_endpoints.dart';
       4             : 
       5             : abstract class HomeRepository {
       6             :   Future<StoriesResponseModel> getUserStories(
       7             :       {required int page, required int size});
       8             : 
       9             :   Future<StoriesResponseModel> getAllStoriesWithOwnUrl(
      10             :       {required int page, required int size});
      11             : }
      12             : 
      13             : class HomeRepositoryImp extends HomeRepository {
      14             :   final NetworkManager _networkManager;
      15             : 
      16           1 :   HomeRepositoryImp({NetworkManager? networkManager}) : _networkManager = networkManager ?? NetworkManager();
      17             : 
      18           1 :   @override
      19             :   Future<StoriesResponseModel> getUserStories(
      20             :       {required int page, required int size}) async {
      21             :     final Result result =
      22           3 :         await _networkManager.get(ApiEndpoints.buildUserStoriesUrl(page, size));
      23           2 :     return StoriesResponseModel.fromJson(result.json);
      24             :   }
      25             : 
      26           1 :   @override
      27             :   Future<StoriesResponseModel> getAllStoriesWithOwnUrl(
      28             :       {required int page, required int size}) async {
      29           1 :     final Result result = await _networkManager
      30           2 :         .get(ApiEndpoints.buildAllStoriesWithOwnUrl(page, size));
      31           2 :     return StoriesResponseModel.fromJson(result.json);
      32             :   }
      33             : }

Generated by: LCOV version 1.14