Closes #5268 - Fix 2 detekt errors
parent
b83ae45c36
commit
768c7c2d35
|
@ -29,13 +29,16 @@ class DrawableTest {
|
||||||
assertTrue(returnRec.contains(0, 0, -10, 10))
|
assertTrue(returnRec.contains(0, 0, -10, 10))
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TestDrawable() : Drawable() {
|
private class TestDrawable : Drawable() {
|
||||||
var boundsChanged: Boolean = false
|
var boundsChanged: Boolean = false
|
||||||
override fun getOpacity(): Int { return 0 }
|
override fun getOpacity(): Int {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
override fun draw(canvas: Canvas) {}
|
override fun draw(canvas: Canvas) {}
|
||||||
override fun setAlpha(alpha: Int) {}
|
override fun setAlpha(alpha: Int) {}
|
||||||
override fun setColorFilter(cf: ColorFilter) {}
|
override fun setColorFilter(cf: ColorFilter) {}
|
||||||
protected override fun onBoundsChange(bounds: Rect) {
|
override fun onBoundsChange(bounds: Rect) {
|
||||||
boundsChanged = true
|
boundsChanged = true
|
||||||
super.onBoundsChange(bounds)
|
super.onBoundsChange(bounds)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,28 +1,26 @@
|
||||||
package org.mozilla.fenix.ext
|
package org.mozilla.fenix.ext
|
||||||
|
|
||||||
import kotlinx.coroutines.ObsoleteCoroutinesApi
|
|
||||||
import org.mozilla.fenix.TestApplication
|
|
||||||
import org.junit.Test
|
|
||||||
import org.junit.runner.RunWith
|
|
||||||
import org.robolectric.RobolectricTestRunner
|
|
||||||
import org.robolectric.annotation.Config
|
|
||||||
import io.mockk.mockk
|
|
||||||
import io.mockk.verify
|
|
||||||
import io.mockk.every
|
|
||||||
import io.mockk.mockkClass
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import androidx.navigation.NavController
|
import androidx.navigation.NavController
|
||||||
|
import androidx.navigation.NavDestination
|
||||||
import androidx.navigation.NavDirections
|
import androidx.navigation.NavDirections
|
||||||
import androidx.navigation.NavOptions
|
import androidx.navigation.NavOptions
|
||||||
import org.mozilla.fenix.BuildConfig
|
|
||||||
import androidx.navigation.NavDestination
|
|
||||||
import androidx.navigation.Navigator.Extras
|
import androidx.navigation.Navigator.Extras
|
||||||
|
import io.mockk.every
|
||||||
|
import io.mockk.mockk
|
||||||
|
import io.mockk.verify
|
||||||
|
import kotlinx.coroutines.ObsoleteCoroutinesApi
|
||||||
|
import org.junit.Test
|
||||||
|
import org.junit.runner.RunWith
|
||||||
|
import org.mozilla.fenix.TestApplication
|
||||||
|
import org.robolectric.RobolectricTestRunner
|
||||||
|
import org.robolectric.annotation.Config
|
||||||
|
|
||||||
@ObsoleteCoroutinesApi
|
@ObsoleteCoroutinesApi
|
||||||
@RunWith(RobolectricTestRunner::class)
|
@RunWith(RobolectricTestRunner::class)
|
||||||
@Config(application = TestApplication::class)
|
@Config(application = TestApplication::class)
|
||||||
|
|
||||||
class NavControllerTest() {
|
class NavControllerTest {
|
||||||
|
|
||||||
val navController: NavController = mockk(relaxed = true)
|
val navController: NavController = mockk(relaxed = true)
|
||||||
val navDirections = mockk<NavDirections>(relaxed = true)
|
val navDirections = mockk<NavDirections>(relaxed = true)
|
||||||
|
@ -30,7 +28,6 @@ class NavControllerTest() {
|
||||||
val mockExtras: Extras = mockk(relaxed = true)
|
val mockExtras: Extras = mockk(relaxed = true)
|
||||||
val mockOptions: NavOptions = mockk(relaxed = true)
|
val mockOptions: NavOptions = mockk(relaxed = true)
|
||||||
val mockBundle: Bundle = mockk(relaxed = true)
|
val mockBundle: Bundle = mockk(relaxed = true)
|
||||||
val mockBuildConfig = mockkClass(BuildConfig::class)
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `Nav with id and directions args`() {
|
fun `Nav with id and directions args`() {
|
||||||
|
|
Loading…
Reference in New Issue