mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
correction
This commit is contained in:
parent
cf726c4f50
commit
5964fe5d16
4 changed files with 7 additions and 6 deletions
|
|
@ -64,8 +64,9 @@ class ContributionsLocalDataSource @Inject constructor(
|
||||||
return contributionDao.deleteContributionsWithStates(states)
|
return contributionDao.deleteContributionsWithStates(states)
|
||||||
}
|
}
|
||||||
|
|
||||||
val contributions: DataSource.Factory<Int, Contribution>
|
fun getContributions(): DataSource.Factory<Int, Contribution> {
|
||||||
get() = contributionDao.fetchContributions()
|
return contributionDao.fetchContributions()
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetches contributions with specific states.
|
* Fetches contributions with specific states.
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ class ContributionsRepository @Inject constructor(private val localDataSource: C
|
||||||
}
|
}
|
||||||
|
|
||||||
fun fetchContributions(): DataSource.Factory<Int, Contribution> {
|
fun fetchContributions(): DataSource.Factory<Int, Contribution> {
|
||||||
return localDataSource.contributions
|
return localDataSource.getContributions()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ class ContributionsListFragmentUnitTests {
|
||||||
Shadows.shadowOf(Looper.getMainLooper()).idle()
|
Shadows.shadowOf(Looper.getMainLooper()).idle()
|
||||||
fragment.rvContributionsList = mock()
|
fragment.rvContributionsList = mock()
|
||||||
fragment.scrollToTop()
|
fragment.scrollToTop()
|
||||||
verify(fragment.rvContributionsList).smoothScrollToPosition(0)
|
verify(fragment.rvContributionsList)?.smoothScrollToPosition(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
||||||
|
|
@ -448,7 +448,7 @@ class MainActivityUnitTests {
|
||||||
fun testOnSetUpPagerNearBy() {
|
fun testOnSetUpPagerNearBy() {
|
||||||
val item = Mockito.mock(MenuItem::class.java)
|
val item = Mockito.mock(MenuItem::class.java)
|
||||||
`when`(item.title).thenReturn(activity.getString(R.string.nearby_fragment))
|
`when`(item.title).thenReturn(activity.getString(R.string.nearby_fragment))
|
||||||
activity.navListener.onNavigationItemSelected(item)
|
activity.navListener?.onNavigationItemSelected(item)
|
||||||
verify(item, Mockito.times(3)).title
|
verify(item, Mockito.times(3)).title
|
||||||
verify(applicationKvStore, Mockito.times(1))
|
verify(applicationKvStore, Mockito.times(1))
|
||||||
.putBoolean("last_opened_nearby", true)
|
.putBoolean("last_opened_nearby", true)
|
||||||
|
|
@ -459,7 +459,7 @@ class MainActivityUnitTests {
|
||||||
fun testOnSetUpPagerOtherThanNearBy() {
|
fun testOnSetUpPagerOtherThanNearBy() {
|
||||||
val item = Mockito.mock(MenuItem::class.java)
|
val item = Mockito.mock(MenuItem::class.java)
|
||||||
`when`(item.title).thenReturn(activity.getString(R.string.bookmarks))
|
`when`(item.title).thenReturn(activity.getString(R.string.bookmarks))
|
||||||
activity.navListener.onNavigationItemSelected(item)
|
activity.navListener?.onNavigationItemSelected(item)
|
||||||
verify(item, Mockito.times(3)).title
|
verify(item, Mockito.times(3)).title
|
||||||
verify(applicationKvStore, Mockito.times(1))
|
verify(applicationKvStore, Mockito.times(1))
|
||||||
.putBoolean("last_opened_nearby", false)
|
.putBoolean("last_opened_nearby", false)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue