Skip to content

Commit d35b4dd

Browse files
committed
feat(events) : modify mock file according to conflict resolution
1 parent 07362b4 commit d35b4dd

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

app/src/main/java/com/android/unio/model/event/EventRepositoryMock.kt

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.android.unio.model.event
22

3+
import com.android.unio.model.association.Association
4+
import com.android.unio.model.firestore.MockReferenceList
35
import com.android.unio.model.map.Location
46
import com.google.firebase.Timestamp
57
import java.util.Date
@@ -26,8 +28,8 @@ open class EventRepositoryMock : EventRepository {
2628
Event(
2729
uid = UUID.randomUUID().toString(),
2830
title = "WESKIC",
29-
organisers = listOf("Organizer 1"),
30-
taggedAssociations = listOf("Coaching IC"),
31+
organisers = MockReferenceList<Association>(),
32+
taggedAssociations = MockReferenceList<Association>(),
3133
image = "weskic",
3234
description =
3335
"The Summer Festival features live music, food stalls, and various activities for all ages.",
@@ -39,8 +41,8 @@ open class EventRepositoryMock : EventRepository {
3941
Event(
4042
uid = UUID.randomUUID().toString(),
4143
title = "Oktoberweek",
42-
organisers = listOf("Organizer 2"),
43-
taggedAssociations = listOf("Beer Lovers Association"),
44+
organisers = MockReferenceList<Association>(),
45+
taggedAssociations = MockReferenceList<Association>(),
4446
image = "oktoberweek",
4547
description =
4648
"An evening of networking with industry leaders and innovators. Don't miss out!",
@@ -52,8 +54,8 @@ open class EventRepositoryMock : EventRepository {
5254
Event(
5355
uid = UUID.randomUUID().toString(),
5456
title = "SwissTech Talk",
55-
organisers = listOf("Organizer 3"),
56-
taggedAssociations = listOf("Tech Enthusiasts"),
57+
organisers = MockReferenceList<Association>(),
58+
taggedAssociations = MockReferenceList<Association>(),
5759
image = "swisstechtalk",
5860
description =
5961
"Learn Kotlin from scratch with real-world examples and expert guidance.",
@@ -65,8 +67,8 @@ open class EventRepositoryMock : EventRepository {
6567
Event(
6668
uid = UUID.randomUUID().toString(),
6769
title = "Lapin Vert",
68-
organisers = listOf("Organizer 4"),
69-
taggedAssociations = listOf("Art Community"),
70+
organisers = MockReferenceList<Association>(),
71+
taggedAssociations = MockReferenceList<Association>(),
7072
image = "lapin_vert",
7173
description =
7274
"Join us for an unforgettable evening featuring local artists and musicians.",
@@ -78,8 +80,8 @@ open class EventRepositoryMock : EventRepository {
7880
Event(
7981
uid = UUID.randomUUID().toString(),
8082
title = "Choose your coach!",
81-
organisers = listOf("Organizer 5"),
82-
taggedAssociations = listOf("Sports Enthusiasts"),
83+
organisers = MockReferenceList<Association>(),
84+
taggedAssociations = MockReferenceList<Association>(),
8385
image = "chooseyourcoach",
8486
description =
8587
"Participate in various sports activities and enjoy food and entertainment.",
@@ -91,8 +93,8 @@ open class EventRepositoryMock : EventRepository {
9193
Event(
9294
uid = UUID.randomUUID().toString(),
9395
title = "Concert",
94-
organisers = listOf("Organizer 6"),
95-
taggedAssociations = listOf("Music Lovers"),
96+
organisers = MockReferenceList<Association>(),
97+
taggedAssociations = MockReferenceList<Association>(),
9698
image = "antoinoxlephar",
9799
description =
98100
"A workshop dedicated to teaching strategies for successful social media marketing.",
@@ -104,8 +106,8 @@ open class EventRepositoryMock : EventRepository {
104106
Event(
105107
uid = UUID.randomUUID().toString(),
106108
title = "Jam Session: Local Artists",
107-
organisers = listOf("Organizer 7"),
108-
taggedAssociations = listOf("Local Talent"),
109+
organisers = MockReferenceList<Association>(),
110+
taggedAssociations = MockReferenceList<Association>(),
109111
image = "photo_2024_10_08_14_57_48",
110112
description =
111113
"An evening of music with local artists. Bring your instruments or just enjoy the show!",
@@ -128,7 +130,9 @@ open class EventRepositoryMock : EventRepository {
128130
) {
129131
// Filter mock events by tagged associations
130132
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
132136
onFailure)
133137
}
134138

0 commit comments

Comments
 (0)