Mesmo após o ajuste da ContactList para Stateful Widget, o tester continua informando o erro. Segue resultado do teste:
Testing started at 06:35 ...
C:\tools\flutter\flutter\bin\flutter.bat --no-color test --machine --plain-name "Should save a contact" test\save_contact_flow.dart
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following TestFailure object was thrown running a test:
No matching calls. All calls: [VERIFIED] MockContactDao.findAll(), MockContactDao.save(Contact{id:
0, fullName: 9999, accountNumber: null}), MockContactDao.findAll()
(If you called `verify(...).called(0);`, please instead use `verifyNever(...);`.)
When the exception was thrown, this was the stack:
#0 fail (package:test_api/src/frontend/expect.dart:154:30)
#1 _VerifyCall._checkWith (package:mockito/src/mock.dart:648:7)
#2 _makeVerify.<anonymous closure> (package:mockito/src/mock.dart:935:18)
#3 main.<anonymous closure> (file:///C:/Estudos/Alura/Flutter/alura-flutter/persistencia/bytebank/test/save_contact_flow.dart:59:11)
<asynchronous suspension>
#4 main.<anonymous closure> (file:///C:/Estudos/Alura/Flutter/alura-flutter/persistencia/bytebank/test/save_contact_flow.dart)
#5 testWidgets.<anonymous closure>.<anonymous closure> (package:flutter_test/src/widget_tester.dart:140:29)
<asynchronous suspension>
#6 testWidgets.<anonymous closure>.<anonymous closure> (package:flutter_test/src/widget_tester.dart)
#7 TestWidgetsFlutterBinding._runTestBody (package:flutter_test/src/binding.dart:703:19)
<asynchronous suspension>
#10 TestWidgetsFlutterBinding._runTest (package:flutter_test/src/binding.dart:683:14)
#11 AutomatedTestWidgetsFlutterBinding.runTest.<anonymous closure> (package:flutter_test/src/binding.dart:1083:24)
#17 AutomatedTestWidgetsFlutterBinding.runTest (package:flutter_test/src/binding.dart:1080:15)
#18 testWidgets.<anonymous closure> (package:flutter_test/src/widget_tester.dart:133:24)
#19 Declarer.test.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:test_api/src/backend/declarer.dart:172:27)
<asynchronous suspension>
#20 Declarer.test.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:test_api/src/backend/declarer.dart)
#21 Invoker.waitForOutstandingCallbacks.<anonymous closure> (package:test_api/src/backend/invoker.dart:246:15)
#26 Invoker.waitForOutstandingCallbacks (package:test_api/src/backend/invoker.dart:243:5)
#27 Declarer.test.<anonymous closure>.<anonymous closure> (package:test_api/src/backend/declarer.dart:170:33)
#32 Declarer.test.<anonymous closure> (package:test_api/src/backend/declarer.dart:169:13)
#33 Invoker._onRun.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:test_api/src/backend/invoker.dart:400:30)
(elided 31 frames from class _FakeAsync, class _RawReceivePortImpl, class _Timer, dart:async, dart:async-patch, and package:stack_trace)
The test description was:
Should save a contact
════════════════════════════════════════════════════════════════════════════════════════════════════
Test failed. See exception logs above.
The test description was: Should save a contact
Apesar do meu ContactList está Stateful Widget, percebi que o ContactItem está como StatelessWidget, será que pode ser isso?