1
1
package com.android.unio.model.event
2
2
3
+ import com.android.unio.model.association.Association
4
+ import com.android.unio.model.firestore.MockReferenceList
3
5
import com.android.unio.model.map.Location
4
6
import com.google.firebase.Timestamp
5
7
import java.util.Date
@@ -26,8 +28,8 @@ open class EventRepositoryMock : EventRepository {
26
28
Event (
27
29
uid = UUID .randomUUID().toString(),
28
30
title = " WESKIC" ,
29
- organisers = listOf ( " Organizer 1 " ),
30
- taggedAssociations = listOf ( " Coaching IC " ),
31
+ organisers = MockReferenceList < Association >( ),
32
+ taggedAssociations = MockReferenceList < Association >( ),
31
33
image = " weskic" ,
32
34
description =
33
35
" The Summer Festival features live music, food stalls, and various activities for all ages." ,
@@ -39,8 +41,8 @@ open class EventRepositoryMock : EventRepository {
39
41
Event (
40
42
uid = UUID .randomUUID().toString(),
41
43
title = " Oktoberweek" ,
42
- organisers = listOf ( " Organizer 2 " ),
43
- taggedAssociations = listOf ( " Beer Lovers Association" ),
44
+ organisers = MockReferenceList < Association >( ),
45
+ taggedAssociations = MockReferenceList < Association >( ),
44
46
image = " oktoberweek" ,
45
47
description =
46
48
" An evening of networking with industry leaders and innovators. Don't miss out!" ,
@@ -52,8 +54,8 @@ open class EventRepositoryMock : EventRepository {
52
54
Event (
53
55
uid = UUID .randomUUID().toString(),
54
56
title = " SwissTech Talk" ,
55
- organisers = listOf ( " Organizer 3 " ),
56
- taggedAssociations = listOf ( " Tech Enthusiasts " ),
57
+ organisers = MockReferenceList < Association >( ),
58
+ taggedAssociations = MockReferenceList < Association >( ),
57
59
image = " swisstechtalk" ,
58
60
description =
59
61
" Learn Kotlin from scratch with real-world examples and expert guidance." ,
@@ -65,8 +67,8 @@ open class EventRepositoryMock : EventRepository {
65
67
Event (
66
68
uid = UUID .randomUUID().toString(),
67
69
title = " Lapin Vert" ,
68
- organisers = listOf ( " Organizer 4 " ),
69
- taggedAssociations = listOf ( " Art Community " ),
70
+ organisers = MockReferenceList < Association >( ),
71
+ taggedAssociations = MockReferenceList < Association >( ),
70
72
image = " lapin_vert" ,
71
73
description =
72
74
" Join us for an unforgettable evening featuring local artists and musicians." ,
@@ -78,8 +80,8 @@ open class EventRepositoryMock : EventRepository {
78
80
Event (
79
81
uid = UUID .randomUUID().toString(),
80
82
title = " Choose your coach!" ,
81
- organisers = listOf ( " Organizer 5 " ),
82
- taggedAssociations = listOf ( " Sports Enthusiasts " ),
83
+ organisers = MockReferenceList < Association >( ),
84
+ taggedAssociations = MockReferenceList < Association >( ),
83
85
image = " chooseyourcoach" ,
84
86
description =
85
87
" Participate in various sports activities and enjoy food and entertainment." ,
@@ -91,8 +93,8 @@ open class EventRepositoryMock : EventRepository {
91
93
Event (
92
94
uid = UUID .randomUUID().toString(),
93
95
title = " Concert" ,
94
- organisers = listOf ( " Organizer 6 " ),
95
- taggedAssociations = listOf ( " Music Lovers " ),
96
+ organisers = MockReferenceList < Association >( ),
97
+ taggedAssociations = MockReferenceList < Association >( ),
96
98
image = " antoinoxlephar" ,
97
99
description =
98
100
" A workshop dedicated to teaching strategies for successful social media marketing." ,
@@ -104,8 +106,8 @@ open class EventRepositoryMock : EventRepository {
104
106
Event (
105
107
uid = UUID .randomUUID().toString(),
106
108
title = " Jam Session: Local Artists" ,
107
- organisers = listOf ( " Organizer 7 " ),
108
- taggedAssociations = listOf ( " Local Talent " ),
109
+ organisers = MockReferenceList < Association >( ),
110
+ taggedAssociations = MockReferenceList < Association >( ),
109
111
image = " photo_2024_10_08_14_57_48" ,
110
112
description =
111
113
" An evening of music with local artists. Bring your instruments or just enjoy the show!" ,
@@ -128,7 +130,9 @@ open class EventRepositoryMock : EventRepository {
128
130
) {
129
131
// Filter mock events by tagged associations
130
132
getEvents(
131
- { events -> onSuccess(events.filter { it.taggedAssociations.contains(association) }) },
133
+ { events ->
134
+ onSuccess(events.filter { it.taggedAssociations.list.value.isEmpty() })
135
+ }, // Now filtering for empty tagged associations
132
136
onFailure)
133
137
}
134
138
0 commit comments