Rename CatalystScreenTestCase.context

Bug: 370394101
Flag: EXEMPT test
Test: N/A
Change-Id: Icfe546154a079f24a75455d25d128d5e550162cd
This commit is contained in:
Jacky Wang
2024-10-16 22:43:39 +08:00
parent 2f80653aab
commit 1e13457267

View File

@@ -42,8 +42,8 @@ class DisplayScreenTest : CatalystScreenTestCase() {
private val mockResources = mock<Resources>()
private val contextWrapper =
object : ContextWrapper(context) {
private val context =
object : ContextWrapper(appContext) {
override fun getResources(): Resources = mockResources
}
@@ -56,14 +56,14 @@ class DisplayScreenTest : CatalystScreenTestCase() {
fun isAvailable_configTrue_shouldReturnTrue() {
mockResources.stub { on { getBoolean(anyInt()) } doReturn true }
assertThat(preferenceScreenCreator.isAvailable(contextWrapper)).isTrue()
assertThat(preferenceScreenCreator.isAvailable(context)).isTrue()
}
@Test
fun isAvailable_configFalse_shouldReturnFalse() {
mockResources.stub { on { getBoolean(anyInt()) } doReturn false }
assertThat(preferenceScreenCreator.isAvailable(contextWrapper)).isFalse()
assertThat(preferenceScreenCreator.isAvailable(context)).isFalse()
}
override fun migration() {