For #8759 Update Unit tests with activityName instead of packageName

innovation-week
mcarare 4 years ago committed by Mihai Adrian
parent 6a1e634e02
commit 55ea92be5b

@ -99,7 +99,7 @@ class ShareControllerTest {
val testController = DefaultShareController(activityContext, shareData, mockk(), mockk(), mockk(),
recentAppStorage, testCoroutineScope, dismiss)
every { activityContext.startActivity(capture(shareIntent)) } just Runs
every { recentAppStorage.updateRecentApp(appShareOption.packageName) } just Runs
every { recentAppStorage.updateRecentApp(appShareOption.activityName) } just Runs
testController.handleShareToApp(appShareOption)
@ -114,7 +114,7 @@ class ShareControllerTest {
assertThat(shareIntent.captured.component!!.className).isEqualTo(appClassName)
}
verifyOrder {
recentAppStorage.updateRecentApp(appShareOption.packageName)
recentAppStorage.updateRecentApp(appShareOption.activityName)
activityContext.startActivity(shareIntent.captured)
dismiss(ShareController.Result.SUCCESS)
}

@ -89,7 +89,7 @@ class ShareViewModelTest {
val recentAppOptions = ArrayList<RecentApp>()
val appEntity: RecentApp = mockk()
every { appEntity.packageName } returns "Package"
every { appEntity.activityName } returns "Activity"
recentAppOptions.add(appEntity)
val storage: RecentAppsStorage = mockk(relaxed = true)
viewModel.recentAppsStorage = storage

Loading…
Cancel
Save