Skip to content

Commit

Permalink
Fix AchievementsControllerTest
Browse files Browse the repository at this point in the history
  • Loading branch information
FloEdelmann committed Mar 12, 2024
1 parent c982432 commit a992715
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.westnordost.streetcomplete.data.user.achievements

import de.westnordost.streetcomplete.data.AllEditTypes
import de.westnordost.streetcomplete.data.osm.mapdata.Element
import de.westnordost.streetcomplete.data.osm.mapdata.MapDataWithGeometry
import de.westnordost.streetcomplete.data.overlays.OverlayRegistry
Expand All @@ -24,10 +25,9 @@ class AchievementsControllerTest {
private lateinit var userAchievementsDao: UserAchievementsDao
private lateinit var userLinksDao: UserLinksDao
private lateinit var statisticsSource: StatisticsSource
private lateinit var allEditTypes: AllEditTypes
private var allLinks: List<Link> = listOf()
private var allAchievements: List<Achievement> = listOf()
private lateinit var questTypeRegistry: QuestTypeRegistry
private lateinit var overlayRegistry: OverlayRegistry

private lateinit var statisticsListener: StatisticsSource.Listener
private lateinit var listener: AchievementsSource.Listener
Expand All @@ -37,8 +37,10 @@ class AchievementsControllerTest {
on(userAchievementsDao.getAll()).thenReturn(mapOf())
userLinksDao = mock()
statisticsSource = mock()
questTypeRegistry = QuestTypeRegistry(listOf(0 to QuestOne, 1 to QuestTwo))
overlayRegistry = OverlayRegistry(listOf(0 to OverlayOne))
allEditTypes = AllEditTypes(listOf(
QuestTypeRegistry(listOf(0 to QuestOne, 1 to QuestTwo)),
OverlayRegistry(listOf(0 to OverlayOne)),
))

listener = mock()

Expand All @@ -54,7 +56,7 @@ class AchievementsControllerTest {
private fun createAchievementsController(): AchievementsController =
AchievementsController(
statisticsSource, userAchievementsDao, userLinksDao,
questTypeRegistry, overlayRegistry, allAchievements, allLinks
allEditTypes, allAchievements, allLinks
).also { it.addListener(listener) }

@Test fun `unlocks DaysActive achievement`() {
Expand Down

0 comments on commit a992715

Please sign in to comment.