You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1.1 KiB
30 lines
1.1 KiB
package allin.data.mock
|
|
|
|
import allin.data.AllInDataSource
|
|
import allin.data.BetDataSource
|
|
import allin.data.ParticipationDataSource
|
|
import allin.data.UserDataSource
|
|
import allin.model.Bet
|
|
import allin.model.BetResult
|
|
import allin.model.Participation
|
|
import allin.model.User
|
|
import java.time.ZonedDateTime
|
|
|
|
class MockDataSource : AllInDataSource() {
|
|
|
|
class MockData {
|
|
val bets by lazy { mutableListOf<Bet>() }
|
|
val results by lazy { mutableListOf<BetResult>() }
|
|
val resultNotifications by lazy { mutableListOf<Pair<String, String>>() }
|
|
val users by lazy { mutableListOf<User>() }
|
|
val lastGifts by lazy { mutableMapOf<String, ZonedDateTime>() }
|
|
val participations by lazy { mutableListOf<Participation>() }
|
|
}
|
|
|
|
private val mockData by lazy { MockData() }
|
|
|
|
override val userDataSource: UserDataSource = MockUserDataSource(mockData)
|
|
override val betDataSource: BetDataSource = MockBetDataSource(mockData)
|
|
override val participationDataSource: ParticipationDataSource = MockParticipationDataSource(mockData)
|
|
}
|