Skip to content

Commit

Permalink
Formatting fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamMc331 committed Nov 26, 2024
1 parent 9d316ee commit c1a7f55
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@ class FakeTeamRepository : TeamRepository {
var activeTeams: List<Team> = emptyList()
var activeTeamsRequestCount: Int = 0

private val _insertedTeams: MutableList<Team> = mutableListOf()
private val mutableInsertedTeams: MutableList<Team> = mutableListOf()

private val _updatedFavorites: MutableMap<String, Boolean> = mutableMapOf()
private val mutableUpdatedFavorites: MutableMap<String, Boolean> = mutableMapOf()

fun verifyFavoriteStatus(
teamId: String,
expectedIsFavorite: Boolean,
) {
require(_updatedFavorites[teamId] == expectedIsFavorite)
require(mutableUpdatedFavorites[teamId] == expectedIsFavorite)
}

fun verifyFavoriteStatusNotUpdated(
teamId: String,
) {
require(_updatedFavorites[teamId] == null)
require(mutableUpdatedFavorites[teamId] == null)
}

val insertedTeams: List<Team>
get() = _insertedTeams.toList()
get() = mutableInsertedTeams.toList()

override fun getFavoriteTeams(): Flow<List<Team>> {
favoriteTeamsRequestCount++
Expand All @@ -49,14 +49,14 @@ class FakeTeamRepository : TeamRepository {
override suspend fun insertTeams(
teams: List<Team>,
) {
this._insertedTeams.addAll(teams)
this.mutableInsertedTeams.addAll(teams)
}

override suspend fun updateIsFavorite(
teamId: String,
isFavorite: Boolean,
) {
_updatedFavorites[teamId] = isFavorite
mutableUpdatedFavorites[teamId] = isFavorite
}

override fun getTeamById(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ data class FeedUiState(
companion object {
private const val PLACEHOLDER_LIST_COUNT = 3

/**
* Returns a default instance of [FeedUiState] where all display models are set
* to placeholders to display during a default loading state.
*/
fun placeholderState(): FeedUiState {
val recentMatches = List(PLACEHOLDER_LIST_COUNT) {
MatchDetailDisplayModel.placeholder
Expand Down

0 comments on commit c1a7f55

Please sign in to comment.