Merge "Rename CatalystScreenTestCase.context" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
4d19f45505
@@ -42,8 +42,8 @@ class DisplayScreenTest : CatalystScreenTestCase() {
|
|||||||
|
|
||||||
private val mockResources = mock<Resources>()
|
private val mockResources = mock<Resources>()
|
||||||
|
|
||||||
private val contextWrapper =
|
private val context =
|
||||||
object : ContextWrapper(context) {
|
object : ContextWrapper(appContext) {
|
||||||
override fun getResources(): Resources = mockResources
|
override fun getResources(): Resources = mockResources
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,14 +56,14 @@ class DisplayScreenTest : CatalystScreenTestCase() {
|
|||||||
fun isAvailable_configTrue_shouldReturnTrue() {
|
fun isAvailable_configTrue_shouldReturnTrue() {
|
||||||
mockResources.stub { on { getBoolean(anyInt()) } doReturn true }
|
mockResources.stub { on { getBoolean(anyInt()) } doReturn true }
|
||||||
|
|
||||||
assertThat(preferenceScreenCreator.isAvailable(contextWrapper)).isTrue()
|
assertThat(preferenceScreenCreator.isAvailable(context)).isTrue()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun isAvailable_configFalse_shouldReturnFalse() {
|
fun isAvailable_configFalse_shouldReturnFalse() {
|
||||||
mockResources.stub { on { getBoolean(anyInt()) } doReturn false }
|
mockResources.stub { on { getBoolean(anyInt()) } doReturn false }
|
||||||
|
|
||||||
assertThat(preferenceScreenCreator.isAvailable(contextWrapper)).isFalse()
|
assertThat(preferenceScreenCreator.isAvailable(context)).isFalse()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun migration() {
|
override fun migration() {
|
||||||
|
Reference in New Issue
Block a user