Jonatas

improve unit tests on get_instance

@@ -15,6 +15,7 @@ dependencies: @@ -15,6 +15,7 @@ dependencies:
15 15
16 dev_dependencies: 16 dev_dependencies:
17 test: ">=1.0.0 <2.0.0" 17 test: ">=1.0.0 <2.0.0"
  18 + test_coverage: ">=0.4.3 <1.0.0"
18 19
19 20
20 # For information on the generic Dart part of this file, see the 21 # For information on the generic Dart part of this file, see the
  1 +// Auto-generated by test_coverage. Do not edit by hand.
  2 +// Consider adding this file to your .gitignore.
  3 +
  4 +import 'get_instance_test.dart' as get_instance_test;
  5 +
  6 +void main() {
  7 + get_instance_test.main();
  8 +}
@@ -13,6 +13,15 @@ class Mock { @@ -13,6 +13,15 @@ class Mock {
13 class Controller {} 13 class Controller {}
14 14
15 class DisposableController extends GetLifeCycle { 15 class DisposableController extends GetLifeCycle {
  16 + DisposableController() {
  17 + onStart.callback = _onStart;
  18 + }
  19 +
  20 + // Internal callback that starts the cycle of this controller.
  21 + void _onStart() {
  22 + onInit();
  23 + }
  24 +
16 bool initialized = false; 25 bool initialized = false;
17 26
18 void onInit() async { 27 void onInit() async {
@@ -18,4 +18,5 @@ dependencies: @@ -18,4 +18,5 @@ dependencies:
18 18
19 dev_dependencies: 19 dev_dependencies:
20 test: ">=1.0.0 <2.0.0" 20 test: ">=1.0.0 <2.0.0"
  21 + test_coverage: ">=0.4.3 <1.0.0"
21   22