From 67a1ec8cd2bd9f5828d5f29a63e67d15979e9728 Mon Sep 17 00:00:00 2001 From: roishoiron Date: Mon, 27 May 2024 12:35:58 +0700 Subject: [PATCH] fix: testing ignored false --- .gitignore | 2 +- test/golden_test/goldens/login_page.png | Bin 0 -> 14813 bytes .../presentation/login_page_test.mocks.dart | 76 +++++++++++++++ test/main_test.dart | 27 ++++++ .../application/user_service_test.mocks.dart | 76 +++++++++++++++ .../entities/login_request_test.mocks.dart | 66 +++++++++++++ .../entities/login_response_test.mocks.dart | 77 ++++++++++++++++ .../interface/user_repository_test.mocks.dart | 57 ++++++++++++ .../provider/database_helper_test.mocks.dart | 87 ++++++++++++++++++ .../user_repository_impl_test.mocks.dart | 68 ++++++++++++++ .../presentation/login_page_test.mocks.dart | 76 +++++++++++++++ 11 files changed, 611 insertions(+), 1 deletion(-) create mode 100644 test/golden_test/goldens/login_page.png create mode 100644 test/integration_test/presentation/login_page_test.mocks.dart create mode 100644 test/main_test.dart create mode 100644 test/unit_test/application/user_service_test.mocks.dart create mode 100644 test/unit_test/domain/entities/login_request_test.mocks.dart create mode 100644 test/unit_test/domain/entities/login_response_test.mocks.dart create mode 100644 test/unit_test/domain/interface/user_repository_test.mocks.dart create mode 100644 test/unit_test/infrastructure/provider/database_helper_test.mocks.dart create mode 100644 test/unit_test/infrastructure/repository/user_repository_impl_test.mocks.dart create mode 100644 test/widget_test/presentation/login_page_test.mocks.dart diff --git a/.gitignore b/.gitignore index 382a2cd..bc0d8c3 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,7 @@ migrate_working_dir/ *.ipr *.iws .idea/ -*.mocks.dart +#*.mocks.dart # The .vscode folder contains launch configuration and tasks you configure in # VS Code which you may wish to be included in version control, so this line diff --git a/test/golden_test/goldens/login_page.png b/test/golden_test/goldens/login_page.png new file mode 100644 index 0000000000000000000000000000000000000000..a62fed8200c20ce65f696cf55bb428024fc38d6b GIT binary patch literal 14813 zcmeHuXH*kvw`LH*3LFa}T@OL&pomBb*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MRE7B5NLkV4qI_X>driJ(Qp!+kc{-COOh#7~03 zU-0cp`<&JhWzY}g_mz|_BtuQn@4^;jRNBVRwzYPDn@ZEMw_gDFV1CflT*iA*HQ)y! z$6wQ@)@}rdMKpL!E)AQ0UB{CubobKm?vf$E1Tf?a+(K!t)ddE3@9yi~-rXDVIy~iO zwH5sOr2~~h!Z%DcFSQgH-i>y=W{J5KFyK-CqUQ@Z2*ev{sl+nS*=1C$r?o$GAthlC zFJr5nw@7w%EcYD`%*jnNm=&Qp?Ei8SF}%}Is1_5umWpARZMWM9(K^V9ubOjV4q2kN zo`Nb079jnL+Y|LExv;f5B68U{stt*O|1m-chQ}hl`H?! zcEuG-sc_A|rB>c|Dz?t#{qxy5Lt!}y-3-@yVa*Lo)?yGA{|{tWqp?;QTE@*#G& zp<~d(djOF{hiVagq-bTD?%0G+XQG^iX1w@7 z!1h>PtGvgLaVo`&`gfyITbHcsA5vp3S(j865`xdL*Ge0swwCpf{wbha#sW5AbL!+t zUERk~#~2xnu3}#$$v71-d&{~|O+e;v_y6n6NvA&welTa^`4}6Grf>WG3zfeApn?Ar z0{gF!8~>Ta|C1W(|DyEyCvyJp)N}t_ login(_i5.LoginRequest? request) => + (super.noSuchMethod( + Invocation.method( + #login, + [request], + ), + returnValue: _i4.Future<_i2.LoginResponse>.value(_FakeLoginResponse_0( + this, + Invocation.method( + #login, + [request], + ), + )), + ) as _i4.Future<_i2.LoginResponse>); + + @override + String generateToken(_i6.User? user) => (super.noSuchMethod( + Invocation.method( + #generateToken, + [user], + ), + returnValue: _i7.dummyValue( + this, + Invocation.method( + #generateToken, + [user], + ), + ), + ) as String); +} diff --git a/test/main_test.dart b/test/main_test.dart new file mode 100644 index 0000000..7b214fa --- /dev/null +++ b/test/main_test.dart @@ -0,0 +1,27 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility in the flutter_test package. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + + + +void main() { + // testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // // Build our app and trigger a frame. + // await tester.pumpWidget(const MyApp()); + + // // Verify that our counter starts at 0. + // expect(find.text('0'), findsOneWidget); + // expect(find.text('1'), findsNothing); + + // // Tap the '+' icon and trigger a frame. + // await tester.tap(find.byIcon(Icons.add)); + // await tester.pump(); + + // // Verify that our counter has incremented. + // expect(find.text('0'), findsNothing); + // expect(find.text('1'), findsOneWidget); + // }); +} diff --git a/test/unit_test/application/user_service_test.mocks.dart b/test/unit_test/application/user_service_test.mocks.dart new file mode 100644 index 0000000..f165d71 --- /dev/null +++ b/test/unit_test/application/user_service_test.mocks.dart @@ -0,0 +1,76 @@ +// Mocks generated by Mockito 5.4.3 from annotations +// in t_ddd_flutter/test/application/user_service_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i4; + +import 'package:mockito/mockito.dart' as _i1; +import 'package:mockito/src/dummies.dart' as _i7; +import 'package:t_ddd_flutter/application/user_service.dart' as _i3; +import 'package:t_ddd_flutter/domain/entities/login_request.dart' as _i5; +import 'package:t_ddd_flutter/domain/entities/login_response.dart' as _i2; +import 'package:t_ddd_flutter/domain/entities/user.dart' as _i6; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: deprecated_member_use +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakeLoginResponse_0 extends _i1.SmartFake implements _i2.LoginResponse { + _FakeLoginResponse_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [UserService]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockUserService extends _i1.Mock implements _i3.UserService { + MockUserService() { + _i1.throwOnMissingStub(this); + } + + @override + _i4.Future<_i2.LoginResponse> login(_i5.LoginRequest? request) => + (super.noSuchMethod( + Invocation.method( + #login, + [request], + ), + returnValue: _i4.Future<_i2.LoginResponse>.value(_FakeLoginResponse_0( + this, + Invocation.method( + #login, + [request], + ), + )), + ) as _i4.Future<_i2.LoginResponse>); + + @override + String generateToken(_i6.User? user) => (super.noSuchMethod( + Invocation.method( + #generateToken, + [user], + ), + returnValue: _i7.dummyValue( + this, + Invocation.method( + #generateToken, + [user], + ), + ), + ) as String); +} diff --git a/test/unit_test/domain/entities/login_request_test.mocks.dart b/test/unit_test/domain/entities/login_request_test.mocks.dart new file mode 100644 index 0000000..e0578d1 --- /dev/null +++ b/test/unit_test/domain/entities/login_request_test.mocks.dart @@ -0,0 +1,66 @@ +// Mocks generated by Mockito 5.4.3 from annotations +// in t_ddd_flutter/test/domain/entities/login_request_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:mockito/mockito.dart' as _i1; +import 'package:mockito/src/dummies.dart' as _i3; +import 'package:t_ddd_flutter/domain/entities/login_request.dart' as _i2; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: deprecated_member_use +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +/// A class which mocks [LoginRequest]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockLoginRequest extends _i1.Mock implements _i2.LoginRequest { + MockLoginRequest() { + _i1.throwOnMissingStub(this); + } + + @override + String get username => (super.noSuchMethod( + Invocation.getter(#username), + returnValue: _i3.dummyValue( + this, + Invocation.getter(#username), + ), + ) as String); + + @override + set username(String? _username) => super.noSuchMethod( + Invocation.setter( + #username, + _username, + ), + returnValueForMissingStub: null, + ); + + @override + String get password => (super.noSuchMethod( + Invocation.getter(#password), + returnValue: _i3.dummyValue( + this, + Invocation.getter(#password), + ), + ) as String); + + @override + set password(String? _password) => super.noSuchMethod( + Invocation.setter( + #password, + _password, + ), + returnValueForMissingStub: null, + ); +} diff --git a/test/unit_test/domain/entities/login_response_test.mocks.dart b/test/unit_test/domain/entities/login_response_test.mocks.dart new file mode 100644 index 0000000..5eeddfa --- /dev/null +++ b/test/unit_test/domain/entities/login_response_test.mocks.dart @@ -0,0 +1,77 @@ +// Mocks generated by Mockito 5.4.3 from annotations +// in t_ddd_flutter/test/domain/entities/login_response_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:mockito/mockito.dart' as _i1; +import 'package:mockito/src/dummies.dart' as _i4; +import 'package:t_ddd_flutter/domain/entities/login_response.dart' as _i3; +import 'package:t_ddd_flutter/domain/entities/user.dart' as _i2; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: deprecated_member_use +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakeUser_0 extends _i1.SmartFake implements _i2.User { + _FakeUser_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [LoginResponse]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockLoginResponse extends _i1.Mock implements _i3.LoginResponse { + MockLoginResponse() { + _i1.throwOnMissingStub(this); + } + + @override + String get token => (super.noSuchMethod( + Invocation.getter(#token), + returnValue: _i4.dummyValue( + this, + Invocation.getter(#token), + ), + ) as String); + + @override + set token(String? _token) => super.noSuchMethod( + Invocation.setter( + #token, + _token, + ), + returnValueForMissingStub: null, + ); + + @override + _i2.User get user => (super.noSuchMethod( + Invocation.getter(#user), + returnValue: _FakeUser_0( + this, + Invocation.getter(#user), + ), + ) as _i2.User); + + @override + set user(_i2.User? _user) => super.noSuchMethod( + Invocation.setter( + #user, + _user, + ), + returnValueForMissingStub: null, + ); +} diff --git a/test/unit_test/domain/interface/user_repository_test.mocks.dart b/test/unit_test/domain/interface/user_repository_test.mocks.dart new file mode 100644 index 0000000..2202d9a --- /dev/null +++ b/test/unit_test/domain/interface/user_repository_test.mocks.dart @@ -0,0 +1,57 @@ +// Mocks generated by Mockito 5.4.3 from annotations +// in t_ddd_flutter/test/domain/interface/user_repository_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i3; + +import 'package:mockito/mockito.dart' as _i1; +import 'package:t_ddd_flutter/domain/entities/user.dart' as _i4; +import 'package:t_ddd_flutter/domain/interface/user_repository.dart' as _i2; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: deprecated_member_use +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +/// A class which mocks [UserRepository]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockUserRepository extends _i1.Mock implements _i2.UserRepository { + MockUserRepository() { + _i1.throwOnMissingStub(this); + } + + @override + _i3.Future<_i4.User?> login( + String? username, + String? password, + ) => + (super.noSuchMethod( + Invocation.method( + #login, + [ + username, + password, + ], + ), + returnValue: _i3.Future<_i4.User?>.value(), + ) as _i3.Future<_i4.User?>); + + @override + _i3.Future register(_i4.User? data) => (super.noSuchMethod( + Invocation.method( + #register, + [data], + ), + returnValue: _i3.Future.value(false), + ) as _i3.Future); +} diff --git a/test/unit_test/infrastructure/provider/database_helper_test.mocks.dart b/test/unit_test/infrastructure/provider/database_helper_test.mocks.dart new file mode 100644 index 0000000..6adacf9 --- /dev/null +++ b/test/unit_test/infrastructure/provider/database_helper_test.mocks.dart @@ -0,0 +1,87 @@ +// Mocks generated by Mockito 5.4.3 from annotations +// in t_ddd_flutter/test/infrastructure/provider/database_helper_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i4; + +import 'package:mockito/mockito.dart' as _i1; +import 'package:sqflite_common_ffi/sqflite_ffi.dart' as _i2; +import 'package:t_ddd_flutter/domain/entities/user.dart' as _i5; +import 'package:t_ddd_flutter/infrastructure/provider/database_helper.dart' + as _i3; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: deprecated_member_use +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakeDatabase_0 extends _i1.SmartFake implements _i2.Database { + _FakeDatabase_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [DatabaseHelper]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockDatabaseHelper extends _i1.Mock implements _i3.DatabaseHelper { + MockDatabaseHelper() { + _i1.throwOnMissingStub(this); + } + + @override + _i4.Future<_i2.Database> get database => (super.noSuchMethod( + Invocation.getter(#database), + returnValue: _i4.Future<_i2.Database>.value(_FakeDatabase_0( + this, + Invocation.getter(#database), + )), + ) as _i4.Future<_i2.Database>); + + @override + _i4.Future insert({ + required String? table, + required Map? data, + }) => + (super.noSuchMethod( + Invocation.method( + #insert, + [], + { + #table: table, + #data: data, + }, + ), + returnValue: _i4.Future.value(), + ) as _i4.Future); + + @override + _i4.Future<_i5.User?> get({ + required String? table, + required Object? id, + }) => + (super.noSuchMethod( + Invocation.method( + #get, + [], + { + #table: table, + #id: id, + }, + ), + returnValue: _i4.Future<_i5.User?>.value(), + ) as _i4.Future<_i5.User?>); +} diff --git a/test/unit_test/infrastructure/repository/user_repository_impl_test.mocks.dart b/test/unit_test/infrastructure/repository/user_repository_impl_test.mocks.dart new file mode 100644 index 0000000..3708c66 --- /dev/null +++ b/test/unit_test/infrastructure/repository/user_repository_impl_test.mocks.dart @@ -0,0 +1,68 @@ +// Mocks generated by Mockito 5.4.3 from annotations +// in t_ddd_flutter/test/infrastructure/repository/user_repository_impl_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i3; + +import 'package:mockito/mockito.dart' as _i1; +import 'package:t_ddd_flutter/domain/entities/user.dart' as _i4; +import 'package:t_ddd_flutter/infrastructure/repository/user_repository_impl.dart' + as _i2; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: deprecated_member_use +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +/// A class which mocks [UserRepositoryImpl]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockUserRepositoryImpl extends _i1.Mock + implements _i2.UserRepositoryImpl { + MockUserRepositoryImpl() { + _i1.throwOnMissingStub(this); + } + + @override + _i3.Future<_i4.User?> login( + String? username, + String? password, + ) => + (super.noSuchMethod( + Invocation.method( + #login, + [ + username, + password, + ], + ), + returnValue: _i3.Future<_i4.User?>.value(), + ) as _i3.Future<_i4.User?>); + + @override + _i3.Future<_i4.User?> getUserById(int? id) => (super.noSuchMethod( + Invocation.method( + #getUserById, + [id], + ), + returnValue: _i3.Future<_i4.User?>.value(), + ) as _i3.Future<_i4.User?>); + + @override + _i3.Future register(_i4.User? data) => (super.noSuchMethod( + Invocation.method( + #register, + [data], + ), + returnValue: _i3.Future.value(false), + ) as _i3.Future); +} diff --git a/test/widget_test/presentation/login_page_test.mocks.dart b/test/widget_test/presentation/login_page_test.mocks.dart new file mode 100644 index 0000000..361da78 --- /dev/null +++ b/test/widget_test/presentation/login_page_test.mocks.dart @@ -0,0 +1,76 @@ +// Mocks generated by Mockito 5.4.3 from annotations +// in t_ddd_flutter/test/presentation/login_page_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i4; + +import 'package:mockito/mockito.dart' as _i1; +import 'package:mockito/src/dummies.dart' as _i7; +import 'package:t_ddd_flutter/application/user_service.dart' as _i3; +import 'package:t_ddd_flutter/domain/entities/login_request.dart' as _i5; +import 'package:t_ddd_flutter/domain/entities/login_response.dart' as _i2; +import 'package:t_ddd_flutter/domain/entities/user.dart' as _i6; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: deprecated_member_use +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakeLoginResponse_0 extends _i1.SmartFake implements _i2.LoginResponse { + _FakeLoginResponse_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [UserService]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockUserService extends _i1.Mock implements _i3.UserService { + MockUserService() { + _i1.throwOnMissingStub(this); + } + + @override + _i4.Future<_i2.LoginResponse> login(_i5.LoginRequest? request) => + (super.noSuchMethod( + Invocation.method( + #login, + [request], + ), + returnValue: _i4.Future<_i2.LoginResponse>.value(_FakeLoginResponse_0( + this, + Invocation.method( + #login, + [request], + ), + )), + ) as _i4.Future<_i2.LoginResponse>); + + @override + String generateToken(_i6.User? user) => (super.noSuchMethod( + Invocation.method( + #generateToken, + [user], + ), + returnValue: _i7.dummyValue( + this, + Invocation.method( + #generateToken, + [user], + ), + ), + ) as String); +}