diff --git a/packages/flutter_dispose_scope/pubspec.yaml b/packages/flutter_dispose_scope/pubspec.yaml index 8e2e107..28ae1e1 100644 --- a/packages/flutter_dispose_scope/pubspec.yaml +++ b/packages/flutter_dispose_scope/pubspec.yaml @@ -16,8 +16,7 @@ dependencies: meta: ^1.3.0 dev_dependencies: - build_runner: ^2.0.3 flutter_test: sdk: flutter lint: ^1.5.3 - mockito: ^5.0.8 + mocktail: ^0.3.0 diff --git a/packages/flutter_dispose_scope/test/disposed_extensions/animation_eager_listener_mixin_disposed_test.dart b/packages/flutter_dispose_scope/test/disposed_extensions/animation_eager_listener_mixin_disposed_test.dart index efa3083..b97db39 100644 --- a/packages/flutter_dispose_scope/test/disposed_extensions/animation_eager_listener_mixin_disposed_test.dart +++ b/packages/flutter_dispose_scope/test/disposed_extensions/animation_eager_listener_mixin_disposed_test.dart @@ -2,12 +2,11 @@ import 'package:dispose_scope/src/dispose_scope.dart'; import 'package:flutter/animation.dart'; import 'package:flutter_dispose_scope/src/disposed_extensions/animation_eager_listener_mixin_disposed.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:mockito/annotations.dart'; -import 'package:mockito/mockito.dart'; +import 'package:mocktail/mocktail.dart'; -import 'animation_eager_listener_mixin_disposed_test.mocks.dart'; +class MockAnimationEagerListenerMixin extends Mock + implements AnimationEagerListenerMixin {} -@GenerateMocks([AnimationEagerListenerMixin]) void main() { group( 'AnimationEagerListenerMixinDisposed', @@ -29,7 +28,7 @@ void main() { await scope.dispose(); - verify(animationEagerListenerMixin.dispose()).called(1); + verify(() => animationEagerListenerMixin.dispose()).called(1); }, ); }, diff --git a/packages/flutter_dispose_scope/test/disposed_extensions/animation_eager_listener_mixin_disposed_test.mocks.dart b/packages/flutter_dispose_scope/test/disposed_extensions/animation_eager_listener_mixin_disposed_test.mocks.dart deleted file mode 100644 index 7e71868..0000000 --- a/packages/flutter_dispose_scope/test/disposed_extensions/animation_eager_listener_mixin_disposed_test.mocks.dart +++ /dev/null @@ -1,38 +0,0 @@ -// Mocks generated by Mockito 5.2.0 from annotations -// in flutter_dispose_scope/test/disposed_extensions/animation_eager_listener_mixin_disposed_test.dart. -// Do not manually edit this file. - -import 'package:flutter/src/animation/listener_helpers.dart' as _i2; -import 'package:mockito/mockito.dart' as _i1; - -// 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: 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 - -/// A class which mocks [AnimationEagerListenerMixin]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockAnimationEagerListenerMixin extends _i1.Mock - implements _i2.AnimationEagerListenerMixin { - MockAnimationEagerListenerMixin() { - _i1.throwOnMissingStub(this); - } - - @override - void didRegisterListener() => - super.noSuchMethod(Invocation.method(#didRegisterListener, []), - returnValueForMissingStub: null); - @override - void didUnregisterListener() => - super.noSuchMethod(Invocation.method(#didUnregisterListener, []), - returnValueForMissingStub: null); - @override - void dispose() => super.noSuchMethod(Invocation.method(#dispose, []), - returnValueForMissingStub: null); -} diff --git a/packages/flutter_dispose_scope/test/disposed_extensions/box_painter_disposed_test.dart b/packages/flutter_dispose_scope/test/disposed_extensions/box_painter_disposed_test.dart index 1f849c4..03e76df 100644 --- a/packages/flutter_dispose_scope/test/disposed_extensions/box_painter_disposed_test.dart +++ b/packages/flutter_dispose_scope/test/disposed_extensions/box_painter_disposed_test.dart @@ -2,12 +2,10 @@ import 'package:dispose_scope/src/dispose_scope.dart'; import 'package:flutter/painting.dart'; import 'package:flutter_dispose_scope/src/disposed_extensions/box_painter_disposed.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:mockito/annotations.dart'; -import 'package:mockito/mockito.dart'; +import 'package:mocktail/mocktail.dart'; -import 'box_painter_disposed_test.mocks.dart'; +class MockBoxPainter extends Mock implements BoxPainter {} -@GenerateMocks([BoxPainter]) void main() { group( 'BoxPainterDisposed', @@ -29,7 +27,7 @@ void main() { await scope.dispose(); - verify(boxPainter.dispose()).called(1); + verify(() => boxPainter.dispose()).called(1); }, ); }, diff --git a/packages/flutter_dispose_scope/test/disposed_extensions/box_painter_disposed_test.mocks.dart b/packages/flutter_dispose_scope/test/disposed_extensions/box_painter_disposed_test.mocks.dart deleted file mode 100644 index de4841d..0000000 --- a/packages/flutter_dispose_scope/test/disposed_extensions/box_painter_disposed_test.mocks.dart +++ /dev/null @@ -1,38 +0,0 @@ -// Mocks generated by Mockito 5.2.0 from annotations -// in flutter_dispose_scope/test/disposed_extensions/box_painter_disposed_test.dart. -// Do not manually edit this file. - -import 'dart:ui' as _i3; - -import 'package:flutter/src/painting/decoration.dart' as _i2; -import 'package:flutter/src/painting/image_provider.dart' as _i4; -import 'package:mockito/mockito.dart' as _i1; - -// 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: 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 - -/// A class which mocks [BoxPainter]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockBoxPainter extends _i1.Mock implements _i2.BoxPainter { - MockBoxPainter() { - _i1.throwOnMissingStub(this); - } - - @override - void paint(_i3.Canvas? canvas, _i3.Offset? offset, - _i4.ImageConfiguration? configuration) => - super.noSuchMethod( - Invocation.method(#paint, [canvas, offset, configuration]), - returnValueForMissingStub: null); - @override - void dispose() => super.noSuchMethod(Invocation.method(#dispose, []), - returnValueForMissingStub: null); -} diff --git a/packages/flutter_dispose_scope/test/disposed_extensions/change_notifier_disposed_test.dart b/packages/flutter_dispose_scope/test/disposed_extensions/change_notifier_disposed_test.dart index 3593fa5..ee88cf9 100644 --- a/packages/flutter_dispose_scope/test/disposed_extensions/change_notifier_disposed_test.dart +++ b/packages/flutter_dispose_scope/test/disposed_extensions/change_notifier_disposed_test.dart @@ -2,12 +2,10 @@ import 'package:dispose_scope/src/dispose_scope.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_dispose_scope/src/disposed_extensions/change_notifier_disposed.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:mockito/annotations.dart'; -import 'package:mockito/mockito.dart'; +import 'package:mocktail/mocktail.dart'; -import 'change_notifier_disposed_test.mocks.dart'; +class MockChangeNotifier extends Mock implements ChangeNotifier {} -@GenerateMocks([ChangeNotifier]) void main() { group( 'ChangeNotifierDisposed', @@ -29,7 +27,7 @@ void main() { await scope.dispose(); - verify(changeNotifier.dispose()).called(1); + verify(() => changeNotifier.dispose()).called(1); }, ); }, diff --git a/packages/flutter_dispose_scope/test/disposed_extensions/change_notifier_disposed_test.mocks.dart b/packages/flutter_dispose_scope/test/disposed_extensions/change_notifier_disposed_test.mocks.dart deleted file mode 100644 index 6ba62f3..0000000 --- a/packages/flutter_dispose_scope/test/disposed_extensions/change_notifier_disposed_test.mocks.dart +++ /dev/null @@ -1,47 +0,0 @@ -// Mocks generated by Mockito 5.2.0 from annotations -// in flutter_dispose_scope/test/disposed_extensions/change_notifier_disposed_test.dart. -// Do not manually edit this file. - -import 'dart:ui' as _i3; - -import 'package:flutter/src/foundation/change_notifier.dart' as _i2; -import 'package:mockito/mockito.dart' as _i1; - -// 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: 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 - -/// A class which mocks [ChangeNotifier]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockChangeNotifier extends _i1.Mock implements _i2.ChangeNotifier { - MockChangeNotifier() { - _i1.throwOnMissingStub(this); - } - - @override - bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) - as bool); - @override - void addListener(_i3.VoidCallback? listener) => - super.noSuchMethod(Invocation.method(#addListener, [listener]), - returnValueForMissingStub: null); - @override - void removeListener(_i3.VoidCallback? listener) => - super.noSuchMethod(Invocation.method(#removeListener, [listener]), - returnValueForMissingStub: null); - @override - void dispose() => super.noSuchMethod(Invocation.method(#dispose, []), - returnValueForMissingStub: null); - @override - void notifyListeners() => - super.noSuchMethod(Invocation.method(#notifyListeners, []), - returnValueForMissingStub: null); -} diff --git a/packages/flutter_dispose_scope/test/disposed_extensions/decoration_image_painter_disposed_test.dart b/packages/flutter_dispose_scope/test/disposed_extensions/decoration_image_painter_disposed_test.dart index 971ce81..9b46d68 100644 --- a/packages/flutter_dispose_scope/test/disposed_extensions/decoration_image_painter_disposed_test.dart +++ b/packages/flutter_dispose_scope/test/disposed_extensions/decoration_image_painter_disposed_test.dart @@ -2,12 +2,11 @@ import 'package:dispose_scope/src/dispose_scope.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_dispose_scope/src/disposed_extensions/decoration_image_painter_disposed.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:mockito/annotations.dart'; -import 'package:mockito/mockito.dart'; +import 'package:mocktail/mocktail.dart'; -import 'decoration_image_painter_disposed_test.mocks.dart'; +class MockDecorationImagePainter extends Mock + implements DecorationImagePainter {} -@GenerateMocks([DecorationImagePainter]) void main() { group( 'DecorationImagePainterDisposed', @@ -29,7 +28,7 @@ void main() { await scope.dispose(); - verify(decorationImagePainter.dispose()).called(1); + verify(() => decorationImagePainter.dispose()).called(1); }, ); }, diff --git a/packages/flutter_dispose_scope/test/disposed_extensions/decoration_image_painter_disposed_test.mocks.dart b/packages/flutter_dispose_scope/test/disposed_extensions/decoration_image_painter_disposed_test.mocks.dart deleted file mode 100644 index 28dbf24..0000000 --- a/packages/flutter_dispose_scope/test/disposed_extensions/decoration_image_painter_disposed_test.mocks.dart +++ /dev/null @@ -1,39 +0,0 @@ -// Mocks generated by Mockito 5.2.0 from annotations -// in flutter_dispose_scope/test/disposed_extensions/decoration_image_painter_disposed_test.dart. -// Do not manually edit this file. - -import 'dart:ui' as _i3; - -import 'package:flutter/src/painting/decoration_image.dart' as _i2; -import 'package:flutter/src/painting/image_provider.dart' as _i4; -import 'package:mockito/mockito.dart' as _i1; - -// 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: 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 - -/// A class which mocks [DecorationImagePainter]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockDecorationImagePainter extends _i1.Mock - implements _i2.DecorationImagePainter { - MockDecorationImagePainter() { - _i1.throwOnMissingStub(this); - } - - @override - void paint(_i3.Canvas? canvas, _i3.Rect? rect, _i3.Path? clipPath, - _i4.ImageConfiguration? configuration) => - super.noSuchMethod( - Invocation.method(#paint, [canvas, rect, clipPath, configuration]), - returnValueForMissingStub: null); - @override - void dispose() => super.noSuchMethod(Invocation.method(#dispose, []), - returnValueForMissingStub: null); -} diff --git a/packages/flutter_dispose_scope/test/disposed_extensions/disposable_build_context_disposed_test.dart b/packages/flutter_dispose_scope/test/disposed_extensions/disposable_build_context_disposed_test.dart index e6defe9..efccc38 100644 --- a/packages/flutter_dispose_scope/test/disposed_extensions/disposable_build_context_disposed_test.dart +++ b/packages/flutter_dispose_scope/test/disposed_extensions/disposable_build_context_disposed_test.dart @@ -2,12 +2,11 @@ import 'package:dispose_scope/src/dispose_scope.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_dispose_scope/src/disposed_extensions/disposable_build_context_disposed.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:mockito/annotations.dart'; -import 'package:mockito/mockito.dart'; +import 'package:mocktail/mocktail.dart'; -import 'disposable_build_context_disposed_test.mocks.dart'; +class MockDisposableBuildContext extends Mock + implements DisposableBuildContext {} -@GenerateMocks([DisposableBuildContext]) void main() { group( 'DisposableBuildContextDisposed', @@ -29,7 +28,7 @@ void main() { await scope.dispose(); - verify(disposableBuildContext.dispose()).called(1); + verify(() => disposableBuildContext.dispose()).called(1); }, ); }, diff --git a/packages/flutter_dispose_scope/test/disposed_extensions/disposable_build_context_disposed_test.mocks.dart b/packages/flutter_dispose_scope/test/disposed_extensions/disposable_build_context_disposed_test.mocks.dart deleted file mode 100644 index b071d94..0000000 --- a/packages/flutter_dispose_scope/test/disposed_extensions/disposable_build_context_disposed_test.mocks.dart +++ /dev/null @@ -1,31 +0,0 @@ -// Mocks generated by Mockito 5.2.0 from annotations -// in flutter_dispose_scope/test/disposed_extensions/disposable_build_context_disposed_test.dart. -// Do not manually edit this file. - -import 'package:flutter/src/widgets/disposable_build_context.dart' as _i3; -import 'package:flutter/src/widgets/framework.dart' as _i1; -import 'package:mockito/mockito.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: 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 - -/// A class which mocks [DisposableBuildContext]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockDisposableBuildContext> - extends _i2.Mock implements _i3.DisposableBuildContext { - MockDisposableBuildContext() { - _i2.throwOnMissingStub(this); - } - - @override - void dispose() => super.noSuchMethod(Invocation.method(#dispose, []), - returnValueForMissingStub: null); -} diff --git a/packages/flutter_dispose_scope/test/disposed_extensions/gesture_recognizer_disposed_test.dart b/packages/flutter_dispose_scope/test/disposed_extensions/gesture_recognizer_disposed_test.dart index 8826eda..f7c0d4d 100644 --- a/packages/flutter_dispose_scope/test/disposed_extensions/gesture_recognizer_disposed_test.dart +++ b/packages/flutter_dispose_scope/test/disposed_extensions/gesture_recognizer_disposed_test.dart @@ -3,7 +3,7 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_dispose_scope/src/disposed_extensions/gesture_recognizer_disposed.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:mockito/mockito.dart'; +import 'package:mocktail/mocktail.dart'; class MockGestureRecognizer extends Mock implements GestureRecognizer { @override @@ -31,7 +31,7 @@ void main() { await scope.dispose(); - verify(gestureRecognizer.dispose()).called(1); + verify(() => gestureRecognizer.dispose()).called(1); }, ); }, diff --git a/packages/flutter_dispose_scope/test/disposed_extensions/image_info_disposed_test.dart b/packages/flutter_dispose_scope/test/disposed_extensions/image_info_disposed_test.dart index 21f866f..5538e76 100644 --- a/packages/flutter_dispose_scope/test/disposed_extensions/image_info_disposed_test.dart +++ b/packages/flutter_dispose_scope/test/disposed_extensions/image_info_disposed_test.dart @@ -2,12 +2,11 @@ import 'package:dispose_scope/src/dispose_scope.dart'; import 'package:flutter/painting.dart'; import 'package:flutter_dispose_scope/src/disposed_extensions/image_info_disposed.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:mockito/annotations.dart'; -import 'package:mockito/mockito.dart'; +import 'package:mocktail/mocktail.dart'; -import 'image_info_disposed_test.mocks.dart'; +// ignore: avoid_implementing_value_types +class MockImageInfo extends Mock implements ImageInfo {} -@GenerateMocks([ImageInfo]) void main() { group( 'ImageInfoDisposed', @@ -29,7 +28,7 @@ void main() { await scope.dispose(); - verify(imageInfo.dispose()).called(1); + verify(() => imageInfo.dispose()).called(1); }, ); }, diff --git a/packages/flutter_dispose_scope/test/disposed_extensions/image_info_disposed_test.mocks.dart b/packages/flutter_dispose_scope/test/disposed_extensions/image_info_disposed_test.mocks.dart deleted file mode 100644 index 74a5f1c..0000000 --- a/packages/flutter_dispose_scope/test/disposed_extensions/image_info_disposed_test.mocks.dart +++ /dev/null @@ -1,54 +0,0 @@ -// Mocks generated by Mockito 5.2.0 from annotations -// in flutter_dispose_scope/test/disposed_extensions/image_info_disposed_test.dart. -// Do not manually edit this file. - -import 'dart:ui' as _i2; - -import 'package:flutter/src/painting/image_stream.dart' as _i3; -import 'package:mockito/mockito.dart' as _i1; - -// 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: 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 - -class _FakeImage_0 extends _i1.Fake implements _i2.Image {} - -class _FakeImageInfo_1 extends _i1.Fake implements _i3.ImageInfo {} - -/// A class which mocks [ImageInfo]. -/// -/// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable -class MockImageInfo extends _i1.Mock implements _i3.ImageInfo { - MockImageInfo() { - _i1.throwOnMissingStub(this); - } - - @override - _i2.Image get image => (super.noSuchMethod(Invocation.getter(#image), - returnValue: _FakeImage_0()) as _i2.Image); - @override - double get scale => - (super.noSuchMethod(Invocation.getter(#scale), returnValue: 0.0) - as double); - @override - int get sizeBytes => - (super.noSuchMethod(Invocation.getter(#sizeBytes), returnValue: 0) - as int); - @override - _i3.ImageInfo clone() => (super.noSuchMethod(Invocation.method(#clone, []), - returnValue: _FakeImageInfo_1()) as _i3.ImageInfo); - @override - bool isCloneOf(_i3.ImageInfo? other) => - (super.noSuchMethod(Invocation.method(#isCloneOf, [other]), - returnValue: false) as bool); - @override - void dispose() => super.noSuchMethod(Invocation.method(#dispose, []), - returnValueForMissingStub: null); -} diff --git a/packages/flutter_dispose_scope/test/disposed_extensions/image_stream_completer_handle_disposed_test.dart b/packages/flutter_dispose_scope/test/disposed_extensions/image_stream_completer_handle_disposed_test.dart index 8ad5cae..4b34d03 100644 --- a/packages/flutter_dispose_scope/test/disposed_extensions/image_stream_completer_handle_disposed_test.dart +++ b/packages/flutter_dispose_scope/test/disposed_extensions/image_stream_completer_handle_disposed_test.dart @@ -2,12 +2,11 @@ import 'package:dispose_scope/src/dispose_scope.dart'; import 'package:flutter/painting.dart'; import 'package:flutter_dispose_scope/src/disposed_extensions/image_stream_completer_handle_disposed.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:mockito/annotations.dart'; -import 'package:mockito/mockito.dart'; +import 'package:mocktail/mocktail.dart'; -import 'image_stream_completer_handle_disposed_test.mocks.dart'; +class MockImageStreamCompleterHandle extends Mock + implements ImageStreamCompleterHandle {} -@GenerateMocks([ImageStreamCompleterHandle]) void main() { group( 'ImageStreamCompleterHandleDisposed', @@ -29,7 +28,7 @@ void main() { await scope.dispose(); - verify(imageStreamCompleterHandle.dispose()).called(1); + verify(() => imageStreamCompleterHandle.dispose()).called(1); }, ); }, diff --git a/packages/flutter_dispose_scope/test/disposed_extensions/image_stream_completer_handle_disposed_test.mocks.dart b/packages/flutter_dispose_scope/test/disposed_extensions/image_stream_completer_handle_disposed_test.mocks.dart deleted file mode 100644 index 9a14cdc..0000000 --- a/packages/flutter_dispose_scope/test/disposed_extensions/image_stream_completer_handle_disposed_test.mocks.dart +++ /dev/null @@ -1,30 +0,0 @@ -// Mocks generated by Mockito 5.2.0 from annotations -// in flutter_dispose_scope/test/disposed_extensions/image_stream_completer_handle_disposed_test.dart. -// Do not manually edit this file. - -import 'package:flutter/src/painting/image_stream.dart' as _i2; -import 'package:mockito/mockito.dart' as _i1; - -// 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: 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 - -/// A class which mocks [ImageStreamCompleterHandle]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockImageStreamCompleterHandle extends _i1.Mock - implements _i2.ImageStreamCompleterHandle { - MockImageStreamCompleterHandle() { - _i1.throwOnMissingStub(this); - } - - @override - void dispose() => super.noSuchMethod(Invocation.method(#dispose, []), - returnValueForMissingStub: null); -} diff --git a/packages/flutter_dispose_scope/test/disposed_extensions/restoration_bucket_disposed_test.dart b/packages/flutter_dispose_scope/test/disposed_extensions/restoration_bucket_disposed_test.dart index d8ef28b..67e0b7c 100644 --- a/packages/flutter_dispose_scope/test/disposed_extensions/restoration_bucket_disposed_test.dart +++ b/packages/flutter_dispose_scope/test/disposed_extensions/restoration_bucket_disposed_test.dart @@ -2,12 +2,10 @@ import 'package:dispose_scope/src/dispose_scope.dart'; import 'package:flutter/services.dart'; import 'package:flutter_dispose_scope/src/disposed_extensions/restoration_bucket_disposed.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:mockito/annotations.dart'; -import 'package:mockito/mockito.dart'; +import 'package:mocktail/mocktail.dart'; -import 'restoration_bucket_disposed_test.mocks.dart'; +class MockRestorationBucket extends Mock implements RestorationBucket {} -@GenerateMocks([RestorationBucket]) void main() { group( 'RestorationBucketDisposed', @@ -29,7 +27,7 @@ void main() { await scope.dispose(); - verify(restorationBucket.dispose()).called(1); + verify(() => restorationBucket.dispose()).called(1); }, ); }, diff --git a/packages/flutter_dispose_scope/test/disposed_extensions/restoration_bucket_disposed_test.mocks.dart b/packages/flutter_dispose_scope/test/disposed_extensions/restoration_bucket_disposed_test.mocks.dart deleted file mode 100644 index 1c1f4a6..0000000 --- a/packages/flutter_dispose_scope/test/disposed_extensions/restoration_bucket_disposed_test.mocks.dart +++ /dev/null @@ -1,72 +0,0 @@ -// Mocks generated by Mockito 5.2.0 from annotations -// in flutter_dispose_scope/test/disposed_extensions/restoration_bucket_disposed_test.dart. -// Do not manually edit this file. - -import 'package:flutter/src/services/restoration.dart' as _i2; -import 'package:mockito/mockito.dart' as _i1; - -// 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: 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 - -class _FakeRestorationBucket_0 extends _i1.Fake - implements _i2.RestorationBucket {} - -/// A class which mocks [RestorationBucket]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockRestorationBucket extends _i1.Mock implements _i2.RestorationBucket { - MockRestorationBucket() { - _i1.throwOnMissingStub(this); - } - - @override - bool get isReplacing => - (super.noSuchMethod(Invocation.getter(#isReplacing), returnValue: false) - as bool); - @override - String get restorationId => - (super.noSuchMethod(Invocation.getter(#restorationId), returnValue: '') - as String); - @override - P? read

(String? restorationId) => - (super.noSuchMethod(Invocation.method(#read, [restorationId])) as P?); - @override - void write

(String? restorationId, P? value) => - super.noSuchMethod(Invocation.method(#write, [restorationId, value]), - returnValueForMissingStub: null); - @override - P? remove

(String? restorationId) => - (super.noSuchMethod(Invocation.method(#remove, [restorationId])) as P?); - @override - bool contains(String? restorationId) => - (super.noSuchMethod(Invocation.method(#contains, [restorationId]), - returnValue: false) as bool); - @override - _i2.RestorationBucket claimChild(String? restorationId, - {Object? debugOwner}) => - (super.noSuchMethod( - Invocation.method( - #claimChild, [restorationId], {#debugOwner: debugOwner}), - returnValue: _FakeRestorationBucket_0()) as _i2.RestorationBucket); - @override - void adoptChild(_i2.RestorationBucket? child) => - super.noSuchMethod(Invocation.method(#adoptChild, [child]), - returnValueForMissingStub: null); - @override - void finalize() => super.noSuchMethod(Invocation.method(#finalize, []), - returnValueForMissingStub: null); - @override - void rename(String? newRestorationId) => - super.noSuchMethod(Invocation.method(#rename, [newRestorationId]), - returnValueForMissingStub: null); - @override - void dispose() => super.noSuchMethod(Invocation.method(#dispose, []), - returnValueForMissingStub: null); -} diff --git a/packages/flutter_dispose_scope/test/disposed_extensions/scroll_activity_disposed_test.dart b/packages/flutter_dispose_scope/test/disposed_extensions/scroll_activity_disposed_test.dart index e0c1cb7..4d6a5eb 100644 --- a/packages/flutter_dispose_scope/test/disposed_extensions/scroll_activity_disposed_test.dart +++ b/packages/flutter_dispose_scope/test/disposed_extensions/scroll_activity_disposed_test.dart @@ -2,12 +2,10 @@ import 'package:dispose_scope/src/dispose_scope.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_dispose_scope/src/disposed_extensions/scroll_activity_disposed.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:mockito/annotations.dart'; -import 'package:mockito/mockito.dart'; +import 'package:mocktail/mocktail.dart'; -import 'scroll_activity_disposed_test.mocks.dart'; +class MockScrollActivity extends Mock implements ScrollActivity {} -@GenerateMocks([ScrollActivity]) void main() { group( 'ScrollActivityDisposed', @@ -29,7 +27,7 @@ void main() { await scope.dispose(); - verify(scrollActivity.dispose()).called(1); + verify(() => scrollActivity.dispose()).called(1); }, ); }, diff --git a/packages/flutter_dispose_scope/test/disposed_extensions/scroll_activity_disposed_test.mocks.dart b/packages/flutter_dispose_scope/test/disposed_extensions/scroll_activity_disposed_test.mocks.dart deleted file mode 100644 index 291ecbc..0000000 --- a/packages/flutter_dispose_scope/test/disposed_extensions/scroll_activity_disposed_test.mocks.dart +++ /dev/null @@ -1,90 +0,0 @@ -// Mocks generated by Mockito 5.2.0 from annotations -// in flutter_dispose_scope/test/disposed_extensions/scroll_activity_disposed_test.dart. -// Do not manually edit this file. - -import 'package:flutter/src/widgets/framework.dart' as _i4; -import 'package:flutter/src/widgets/scroll_activity.dart' as _i2; -import 'package:flutter/src/widgets/scroll_metrics.dart' as _i3; -import 'package:mockito/mockito.dart' as _i1; - -// 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: 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 - -class _FakeScrollActivityDelegate_0 extends _i1.Fake - implements _i2.ScrollActivityDelegate {} - -/// A class which mocks [ScrollActivity]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockScrollActivity extends _i1.Mock implements _i2.ScrollActivity { - MockScrollActivity() { - _i1.throwOnMissingStub(this); - } - - @override - _i2.ScrollActivityDelegate get delegate => - (super.noSuchMethod(Invocation.getter(#delegate), - returnValue: _FakeScrollActivityDelegate_0()) - as _i2.ScrollActivityDelegate); - @override - bool get shouldIgnorePointer => - (super.noSuchMethod(Invocation.getter(#shouldIgnorePointer), - returnValue: false) as bool); - @override - bool get isScrolling => - (super.noSuchMethod(Invocation.getter(#isScrolling), returnValue: false) - as bool); - @override - double get velocity => - (super.noSuchMethod(Invocation.getter(#velocity), returnValue: 0.0) - as double); - @override - void updateDelegate(_i2.ScrollActivityDelegate? value) => - super.noSuchMethod(Invocation.method(#updateDelegate, [value]), - returnValueForMissingStub: null); - @override - void resetActivity() => - super.noSuchMethod(Invocation.method(#resetActivity, []), - returnValueForMissingStub: null); - @override - void dispatchScrollStartNotification( - _i3.ScrollMetrics? metrics, _i4.BuildContext? context) => - super.noSuchMethod( - Invocation.method( - #dispatchScrollStartNotification, [metrics, context]), - returnValueForMissingStub: null); - @override - void dispatchScrollUpdateNotification(_i3.ScrollMetrics? metrics, - _i4.BuildContext? context, double? scrollDelta) => - super.noSuchMethod( - Invocation.method(#dispatchScrollUpdateNotification, - [metrics, context, scrollDelta]), - returnValueForMissingStub: null); - @override - void dispatchOverscrollNotification(_i3.ScrollMetrics? metrics, - _i4.BuildContext? context, double? overscroll) => - super.noSuchMethod( - Invocation.method( - #dispatchOverscrollNotification, [metrics, context, overscroll]), - returnValueForMissingStub: null); - @override - void dispatchScrollEndNotification( - _i3.ScrollMetrics? metrics, _i4.BuildContext? context) => - super.noSuchMethod( - Invocation.method(#dispatchScrollEndNotification, [metrics, context]), - returnValueForMissingStub: null); - @override - void applyNewDimensions() => - super.noSuchMethod(Invocation.method(#applyNewDimensions, []), - returnValueForMissingStub: null); - @override - void dispose() => super.noSuchMethod(Invocation.method(#dispose, []), - returnValueForMissingStub: null); -} diff --git a/packages/flutter_dispose_scope/test/disposed_extensions/scroll_drag_controller_disposed_test.dart b/packages/flutter_dispose_scope/test/disposed_extensions/scroll_drag_controller_disposed_test.dart index b8d4e9c..790b92b 100644 --- a/packages/flutter_dispose_scope/test/disposed_extensions/scroll_drag_controller_disposed_test.dart +++ b/packages/flutter_dispose_scope/test/disposed_extensions/scroll_drag_controller_disposed_test.dart @@ -2,12 +2,10 @@ import 'package:dispose_scope/src/dispose_scope.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_dispose_scope/src/disposed_extensions/scroll_drag_controller_disposed.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:mockito/annotations.dart'; -import 'package:mockito/mockito.dart'; +import 'package:mocktail/mocktail.dart'; -import 'scroll_drag_controller_disposed_test.mocks.dart'; +class MockScrollDragController extends Mock implements ScrollDragController {} -@GenerateMocks([ScrollDragController]) void main() { group( 'ScrollDragControllerDisposed', @@ -29,7 +27,7 @@ void main() { await scope.dispose(); - verify(scrollDragController.dispose()).called(1); + verify(() => scrollDragController.dispose()).called(1); }, ); }, diff --git a/packages/flutter_dispose_scope/test/disposed_extensions/scroll_drag_controller_disposed_test.mocks.dart b/packages/flutter_dispose_scope/test/disposed_extensions/scroll_drag_controller_disposed_test.mocks.dart deleted file mode 100644 index 9a2b14a..0000000 --- a/packages/flutter_dispose_scope/test/disposed_extensions/scroll_drag_controller_disposed_test.mocks.dart +++ /dev/null @@ -1,54 +0,0 @@ -// Mocks generated by Mockito 5.2.0 from annotations -// in flutter_dispose_scope/test/disposed_extensions/scroll_drag_controller_disposed_test.dart. -// Do not manually edit this file. - -import 'package:flutter/gestures.dart' as _i3; -import 'package:flutter/src/widgets/scroll_activity.dart' as _i2; -import 'package:mockito/mockito.dart' as _i1; - -// 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: 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 - -class _FakeScrollActivityDelegate_0 extends _i1.Fake - implements _i2.ScrollActivityDelegate {} - -/// A class which mocks [ScrollDragController]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockScrollDragController extends _i1.Mock - implements _i2.ScrollDragController { - MockScrollDragController() { - _i1.throwOnMissingStub(this); - } - - @override - _i2.ScrollActivityDelegate get delegate => - (super.noSuchMethod(Invocation.getter(#delegate), - returnValue: _FakeScrollActivityDelegate_0()) - as _i2.ScrollActivityDelegate); - @override - void updateDelegate(_i2.ScrollActivityDelegate? value) => - super.noSuchMethod(Invocation.method(#updateDelegate, [value]), - returnValueForMissingStub: null); - @override - void update(_i3.DragUpdateDetails? details) => - super.noSuchMethod(Invocation.method(#update, [details]), - returnValueForMissingStub: null); - @override - void end(_i3.DragEndDetails? details) => - super.noSuchMethod(Invocation.method(#end, [details]), - returnValueForMissingStub: null); - @override - void cancel() => super.noSuchMethod(Invocation.method(#cancel, []), - returnValueForMissingStub: null); - @override - void dispose() => super.noSuchMethod(Invocation.method(#dispose, []), - returnValueForMissingStub: null); -} diff --git a/packages/flutter_dispose_scope/test/disposed_extensions/semantics_handle_disposed_test.dart b/packages/flutter_dispose_scope/test/disposed_extensions/semantics_handle_disposed_test.dart index 3569a13..20c0a00 100644 --- a/packages/flutter_dispose_scope/test/disposed_extensions/semantics_handle_disposed_test.dart +++ b/packages/flutter_dispose_scope/test/disposed_extensions/semantics_handle_disposed_test.dart @@ -1,12 +1,10 @@ import 'package:dispose_scope/src/dispose_scope.dart'; import 'package:flutter_dispose_scope/src/disposed_extensions/semantics_handle_disposed.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:mockito/annotations.dart'; -import 'package:mockito/mockito.dart'; +import 'package:mocktail/mocktail.dart'; -import 'semantics_handle_disposed_test.mocks.dart'; +class MockSemanticsHandle extends Mock implements SemanticsHandle {} -@GenerateMocks([SemanticsHandle]) void main() { group( 'SemanticsHandleDisposed', @@ -28,7 +26,7 @@ void main() { await scope.dispose(); - verify(semanticsHandle.dispose()).called(1); + verify(() => semanticsHandle.dispose()).called(1); }, ); }, diff --git a/packages/flutter_dispose_scope/test/disposed_extensions/semantics_handle_disposed_test.mocks.dart b/packages/flutter_dispose_scope/test/disposed_extensions/semantics_handle_disposed_test.mocks.dart deleted file mode 100644 index 06b75c5..0000000 --- a/packages/flutter_dispose_scope/test/disposed_extensions/semantics_handle_disposed_test.mocks.dart +++ /dev/null @@ -1,29 +0,0 @@ -// Mocks generated by Mockito 5.2.0 from annotations -// in flutter_dispose_scope/test/disposed_extensions/semantics_handle_disposed_test.dart. -// Do not manually edit this file. - -import 'package:flutter/src/rendering/object.dart' as _i2; -import 'package:mockito/mockito.dart' as _i1; - -// 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: 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 - -/// A class which mocks [SemanticsHandle]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockSemanticsHandle extends _i1.Mock implements _i2.SemanticsHandle { - MockSemanticsHandle() { - _i1.throwOnMissingStub(this); - } - - @override - void dispose() => super.noSuchMethod(Invocation.method(#dispose, []), - returnValueForMissingStub: null); -} diff --git a/packages/flutter_dispose_scope/test/disposed_extensions/state_disposed_test.dart b/packages/flutter_dispose_scope/test/disposed_extensions/state_disposed_test.dart index 7d57b03..e90acff 100644 --- a/packages/flutter_dispose_scope/test/disposed_extensions/state_disposed_test.dart +++ b/packages/flutter_dispose_scope/test/disposed_extensions/state_disposed_test.dart @@ -2,7 +2,7 @@ import 'package:dispose_scope/src/dispose_scope.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_dispose_scope/src/disposed_extensions/state_disposed.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:mockito/mockito.dart'; +import 'package:mocktail/mocktail.dart'; class MockState extends Mock implements State { @override @@ -31,7 +31,7 @@ void main() { await scope.dispose(); // ignore: invalid_use_of_protected_member - verify(state.dispose()).called(1); + verify(() => state.dispose()).called(1); }, ); }, diff --git a/packages/flutter_dispose_scope/test/disposed_extensions/ticker_disposed_test.dart b/packages/flutter_dispose_scope/test/disposed_extensions/ticker_disposed_test.dart index 8ce3f2a..d2d51f6 100644 --- a/packages/flutter_dispose_scope/test/disposed_extensions/ticker_disposed_test.dart +++ b/packages/flutter_dispose_scope/test/disposed_extensions/ticker_disposed_test.dart @@ -2,7 +2,7 @@ import 'package:dispose_scope/src/dispose_scope.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_dispose_scope/src/disposed_extensions/ticker_disposed.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:mockito/mockito.dart'; +import 'package:mocktail/mocktail.dart'; class MockTicker extends Mock implements Ticker { @override @@ -30,7 +30,7 @@ void main() { await scope.dispose(); - verify(ticker.dispose()).called(1); + verify(() => ticker.dispose()).called(1); }, ); },