Skip to content

Instantly share code, notes, and snippets.

@utkarsh-UK
Last active November 18, 2020 19:03
Show Gist options
  • Save utkarsh-UK/a8ab91c599cbf09c44148559ff982a84 to your computer and use it in GitHub Desktop.
Save utkarsh-UK/a8ab91c599cbf09c44148559ff982a84 to your computer and use it in GitHub Desktop.
import 'package:cloud_firestore/cloud_firestore.dart';
class MockFirestore extends Mock implements FirebaseFirestore {}
class MockCollectionReference extends Mock implements CollectionReference {}
class MockDocumentReference extends Mock implements DocumentReference {}
class MockDocumentSnapshot extends Mock implements DocumentSnapshot {}
void main() {
MockFirestore instance;
MockDocumentSnapshot mockDocumentSnapshot;
MockCollectionReference mockCollectionReference;
MockDocumentReference mockDocumentReference;
setUp(() {
instance = MockFirestore();
mockCollectionReference = MockCollectionReference();
mockDocumentReference = MockDocumentReference();
mockDocumentSnapshot = MockDocumentSnapshot();
});
test('should return data when the call to remote source is successful.', () async {
// arrange
//act
//assert
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment