|
|
@ -82,7 +82,7 @@ void main() {
|
|
|
|
|
|
|
|
|
|
|
|
when(() => firestore.collection('leaderboard'))
|
|
|
|
when(() => firestore.collection('leaderboard'))
|
|
|
|
.thenAnswer((_) => collectionReference);
|
|
|
|
.thenAnswer((_) => collectionReference);
|
|
|
|
when(() => collectionReference.orderBy('score'))
|
|
|
|
when(() => collectionReference.orderBy('score', descending: true))
|
|
|
|
.thenAnswer((_) => query);
|
|
|
|
.thenAnswer((_) => query);
|
|
|
|
when(() => query.limit(10)).thenAnswer((_) => query);
|
|
|
|
when(() => query.limit(10)).thenAnswer((_) => query);
|
|
|
|
when(query.get).thenAnswer((_) async => querySnapshot);
|
|
|
|
when(query.get).thenAnswer((_) async => querySnapshot);
|
|
|
@ -173,7 +173,7 @@ void main() {
|
|
|
|
.thenAnswer((_) => collectionReference);
|
|
|
|
.thenAnswer((_) => collectionReference);
|
|
|
|
when(() => collectionReference.add(any()))
|
|
|
|
when(() => collectionReference.add(any()))
|
|
|
|
.thenAnswer((_) async => documentReference);
|
|
|
|
.thenAnswer((_) async => documentReference);
|
|
|
|
when(() => collectionReference.orderBy('score'))
|
|
|
|
when(() => collectionReference.orderBy('score', descending: true))
|
|
|
|
.thenAnswer((_) => query);
|
|
|
|
.thenAnswer((_) => query);
|
|
|
|
when(query.get).thenAnswer((_) async => querySnapshot);
|
|
|
|
when(query.get).thenAnswer((_) async => querySnapshot);
|
|
|
|
when(() => querySnapshot.docs).thenReturn(queryDocumentSnapshots);
|
|
|
|
when(() => querySnapshot.docs).thenReturn(queryDocumentSnapshots);
|
|
|
@ -203,7 +203,8 @@ void main() {
|
|
|
|
test(
|
|
|
|
test(
|
|
|
|
'throws FetchPlayerRankingException when Exception occurs '
|
|
|
|
'throws FetchPlayerRankingException when Exception occurs '
|
|
|
|
'when trying to retrieve information from firestore', () async {
|
|
|
|
'when trying to retrieve information from firestore', () async {
|
|
|
|
when(() => collectionReference.orderBy('score')).thenThrow(Exception());
|
|
|
|
when(() => collectionReference.orderBy('score', descending: true))
|
|
|
|
|
|
|
|
.thenThrow(Exception());
|
|
|
|
|
|
|
|
|
|
|
|
expect(
|
|
|
|
expect(
|
|
|
|
() => leaderboardRepository.addLeaderboardEntry(leaderboardEntry),
|
|
|
|
() => leaderboardRepository.addLeaderboardEntry(leaderboardEntry),
|
|
|
|