Open AYM1607 opened 5 years ago
In contrast to the http package, cloud_firestore does not provide a mock instance.
We have to use mockito to test the methods inside the provider.
the following file provides an example on how to test using it: https://github.com/brianegan/flutter_architecture_samples/blob/3fae7fbc01fc1dc87cbfee7208370eb854879b03/example/firebase_flutter_repository/test/firebase_flutter_repository_test.dart
Tests for the operations regarding events and tasks are already in place.
https://github.com/AYM1607/do_more/commit/4aadfbde8c179c361b01b8c8ecfa2f61ef05217a fixes this issue
More tests are needing for checking edge cases, as in firestore not returning anything or Futures failing.
In contrast to the http package, cloud_firestore does not provide a mock instance.
We have to use mockito to test the methods inside the provider.
the following file provides an example on how to test using it: https://github.com/brianegan/flutter_architecture_samples/blob/3fae7fbc01fc1dc87cbfee7208370eb854879b03/example/firebase_flutter_repository/test/firebase_flutter_repository_test.dart