-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
783a843
commit c8d8e34
Showing
12 changed files
with
138 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...src/androidTest/kotlin/ru/pixnews/inject/data/MockObserveUpcomingReleasesByDateUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright (c) 2023, the Pixnews project authors and contributors. Please see the AUTHORS file for details. | ||
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. | ||
*/ | ||
|
||
package ru.pixnews.inject.data | ||
|
||
import com.squareup.anvil.annotations.ContributesBinding | ||
import kotlinx.coroutines.flow.Flow | ||
import kotlinx.coroutines.flow.flowOf | ||
import ru.pixnews.domain.model.game.Game | ||
import ru.pixnews.domain.model.game.GameField | ||
import ru.pixnews.domain.model.game.GameFixtures | ||
import ru.pixnews.domain.model.game.game.beyondGoodEvil2 | ||
import ru.pixnews.domain.model.game.game.gta6 | ||
import ru.pixnews.domain.model.game.game.halfLife3 | ||
import ru.pixnews.domain.model.game.game.hytale | ||
import ru.pixnews.domain.model.game.game.project007 | ||
import ru.pixnews.domain.model.game.game.sims5 | ||
import ru.pixnews.domain.model.game.game.slimeRancher2 | ||
import ru.pixnews.domain.model.game.game.smalland | ||
import ru.pixnews.domain.model.game.game.starWarsEclipse | ||
import ru.pixnews.domain.model.game.game.theLostWild | ||
import ru.pixnews.feature.calendar.data.domain.ObserveUpcomingReleasesByDateUseCase | ||
import ru.pixnews.feature.calendar.domain.DefaultObserveUpcomingReleasesByDateUseCase | ||
import ru.pixnews.foundation.di.base.scopes.AppScope | ||
import ru.pixnews.library.functional.network.NetworkRequestStatus | ||
import javax.inject.Inject | ||
|
||
@ContributesBinding( | ||
boundType = ObserveUpcomingReleasesByDateUseCase::class, | ||
scope = AppScope::class, | ||
replaces = [DefaultObserveUpcomingReleasesByDateUseCase::class], | ||
) | ||
class MockObserveUpcomingReleasesByDateUseCase @Inject constructor() : ObserveUpcomingReleasesByDateUseCase { | ||
override fun createUpcomingReleasesObservable( | ||
requiredFields: Set<GameField>, | ||
): Flow<NetworkRequestStatus<List<Game>>> { | ||
return flowOf( | ||
NetworkRequestStatus.completeSuccess( | ||
listOf( | ||
GameFixtures.slimeRancher2, | ||
GameFixtures.hytale, | ||
GameFixtures.gta6, | ||
GameFixtures.theLostWild, | ||
GameFixtures.sims5, | ||
GameFixtures.beyondGoodEvil2, | ||
GameFixtures.starWarsEclipse, | ||
GameFixtures.halfLife3, | ||
GameFixtures.smalland, | ||
GameFixtures.project007, | ||
), | ||
), | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...blic/main/ru/pixnews/feature/calendar/data/domain/ObserveUpcomingReleasesByDateUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Copyright (c) 2023, the Pixnews project authors and contributors. Please see the AUTHORS file for details. | ||
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. | ||
*/ | ||
|
||
package ru.pixnews.feature.calendar.data.domain | ||
|
||
import kotlinx.coroutines.flow.Flow | ||
import ru.pixnews.domain.model.game.Game | ||
import ru.pixnews.domain.model.game.GameField | ||
import ru.pixnews.library.functional.network.NetworkRequestStatus | ||
|
||
public interface ObserveUpcomingReleasesByDateUseCase { | ||
public fun createUpcomingReleasesObservable( | ||
requiredFields: Set<GameField>, | ||
): Flow<NetworkRequestStatus<List<Game>>> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...re/calendar/test-constants/main/ru/pixnews/feature/calendar/test/fixtures/TestFixtures.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (c) 2023, the Pixnews project authors and contributors. Please see the AUTHORS file for details. | ||
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. | ||
*/ | ||
|
||
package ru.pixnews.feature.calendar.test.fixtures | ||
|
||
import ru.pixnews.domain.model.game.Game | ||
import ru.pixnews.domain.model.game.GameFixtures | ||
import ru.pixnews.domain.model.game.game.beyondGoodEvil2 | ||
import ru.pixnews.domain.model.game.game.gta6 | ||
import ru.pixnews.domain.model.game.game.halfLife3 | ||
import ru.pixnews.domain.model.game.game.hytale | ||
import ru.pixnews.domain.model.game.game.project007 | ||
import ru.pixnews.domain.model.game.game.sims5 | ||
import ru.pixnews.domain.model.game.game.slimeRancher2 | ||
import ru.pixnews.domain.model.game.game.smalland | ||
import ru.pixnews.domain.model.game.game.starWarsEclipse | ||
import ru.pixnews.domain.model.game.game.theLostWild | ||
|
||
public object TestFixtures { | ||
val previewSuccessState: List<Game> = listOf( | ||
GameFixtures.slimeRancher2, | ||
GameFixtures.hytale, | ||
GameFixtures.gta6, | ||
GameFixtures.theLostWild, | ||
GameFixtures.sims5, | ||
GameFixtures.beyondGoodEvil2, | ||
GameFixtures.starWarsEclipse, | ||
GameFixtures.halfLife3, | ||
GameFixtures.smalland, | ||
GameFixtures.project007, | ||
) | ||
} |