Skip to content

Commit

Permalink
🐛 Testing Mocking
Browse files Browse the repository at this point in the history
  • Loading branch information
rexthecoder committed Oct 25, 2021
1 parent cf43b5b commit 0415174
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 57 deletions.
7 changes: 7 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
mockito:
dependency: "direct dev"
description:
name: mockito
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.16"
octo_image:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ dev_dependencies:
flutter_native_splash: ^1.2.4
flutter_test:
sdk: flutter
mockito: ^5.0.16

flutter:
uses-material-design: true
Expand Down
11 changes: 0 additions & 11 deletions test/app/app_test.dart

This file was deleted.

16 changes: 16 additions & 0 deletions test/app/view/app_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/mockito.dart';
import 'package:news360/src/app/app.dart';
import 'package:news360/src/logic/authentication/export.dart';

class MockAuthController extends Mock implements AuthenticationController {}

class MockAuthService extends Mock implements AuthConfiguration {}

void main() {
group('App', () {
testWidgets('renders Onboarding Page', (tester) async {
await tester.pumpWidget(const App());
});
});
}
8 changes: 8 additions & 0 deletions test/helpers/helpers.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright (c) 2021, Very Good Ventures
// https://verygood.ventures
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.

export 'pump_app.dart';
20 changes: 20 additions & 0 deletions test/helpers/pump_app.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright (c) 2021, Very Good Ventures
// https://verygood.ventures
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:get/get.dart';

extension PumpApp on WidgetTester {
Future<void> pumpApp(Widget widget) {
return pumpWidget(
GetMaterialApp(
home: widget,
),
);
}
}
15 changes: 0 additions & 15 deletions test/unit_test.dart

This file was deleted.

31 changes: 0 additions & 31 deletions test/widget_test.dart

This file was deleted.

0 comments on commit 0415174

Please sign in to comment.