|
|
@ -44,7 +44,7 @@ class CompositeUserNewsResourceRepositoryTest {
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
fun whenNoFilters_allNewsResourcesAreReturned() = runTest {
|
|
|
|
fun whenNoFilters_allNewsResourcesAreReturned() = runTest {
|
|
|
|
// Obtain the user news resources flow.
|
|
|
|
// Obtain the user news resources flow.
|
|
|
|
val userNewsResources = userNewsResourceRepository.getUserNewsResources()
|
|
|
|
val userNewsResources = userNewsResourceRepository.observeAll()
|
|
|
|
|
|
|
|
|
|
|
|
// Send some news resources and user data into the data repositories.
|
|
|
|
// Send some news resources and user data into the data repositories.
|
|
|
|
newsRepository.sendNewsResources(sampleNewsResources)
|
|
|
|
newsRepository.sendNewsResources(sampleNewsResources)
|
|
|
@ -68,7 +68,7 @@ class CompositeUserNewsResourceRepositoryTest {
|
|
|
|
fun whenFilteredByTopicId_matchingNewsResourcesAreReturned() = runTest {
|
|
|
|
fun whenFilteredByTopicId_matchingNewsResourcesAreReturned() = runTest {
|
|
|
|
// Obtain a stream of user news resources for the given topic id.
|
|
|
|
// Obtain a stream of user news resources for the given topic id.
|
|
|
|
val userNewsResources =
|
|
|
|
val userNewsResources =
|
|
|
|
userNewsResourceRepository.getUserNewsResources(
|
|
|
|
userNewsResourceRepository.observeAll(
|
|
|
|
NewsResourceQuery(
|
|
|
|
NewsResourceQuery(
|
|
|
|
filterTopicIds = setOf(
|
|
|
|
filterTopicIds = setOf(
|
|
|
|
sampleTopic1.id,
|
|
|
|
sampleTopic1.id,
|
|
|
@ -93,7 +93,7 @@ class CompositeUserNewsResourceRepositoryTest {
|
|
|
|
fun whenFilteredByFollowedTopics_matchingNewsResourcesAreReturned() = runTest {
|
|
|
|
fun whenFilteredByFollowedTopics_matchingNewsResourcesAreReturned() = runTest {
|
|
|
|
// Obtain a stream of user news resources for the given topic id.
|
|
|
|
// Obtain a stream of user news resources for the given topic id.
|
|
|
|
val userNewsResources =
|
|
|
|
val userNewsResources =
|
|
|
|
userNewsResourceRepository.getUserNewsResourcesForFollowedTopics()
|
|
|
|
userNewsResourceRepository.observeAllForFollowedTopics()
|
|
|
|
|
|
|
|
|
|
|
|
// Send test data into the repositories.
|
|
|
|
// Send test data into the repositories.
|
|
|
|
val userData = emptyUserData.copy(
|
|
|
|
val userData = emptyUserData.copy(
|
|
|
@ -114,7 +114,7 @@ class CompositeUserNewsResourceRepositoryTest {
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
fun whenFilteredByBookmarkedResources_matchingNewsResourcesAreReturned() = runTest {
|
|
|
|
fun whenFilteredByBookmarkedResources_matchingNewsResourcesAreReturned() = runTest {
|
|
|
|
// Obtain the bookmarked user news resources flow.
|
|
|
|
// Obtain the bookmarked user news resources flow.
|
|
|
|
val userNewsResources = userNewsResourceRepository.getBookmarkedUserNewsResources()
|
|
|
|
val userNewsResources = userNewsResourceRepository.observeAllBookmarked()
|
|
|
|
|
|
|
|
|
|
|
|
// Send some news resources and user data into the data repositories.
|
|
|
|
// Send some news resources and user data into the data repositories.
|
|
|
|
newsRepository.sendNewsResources(sampleNewsResources)
|
|
|
|
newsRepository.sendNewsResources(sampleNewsResources)
|
|
|
|