fix(image): Coil 2 대응 BlurTransformation 구현을 추가한다
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package kr.co.vividnext.sodalive.common.image
|
||||
|
||||
import android.content.Context
|
||||
import io.mockk.mockk
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertThrows
|
||||
import org.junit.Test
|
||||
|
||||
class BlurTransformationTest {
|
||||
|
||||
@Test
|
||||
fun `cacheKey includes radius and sampling`() {
|
||||
val transformation = BlurTransformation(
|
||||
context = mockk<Context>(relaxed = true),
|
||||
radius = 25f,
|
||||
sampling = 2.5f
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
"kr.co.vividnext.sodalive.common.image.BlurTransformation-25.0-2.5",
|
||||
transformation.cacheKey
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `constructor rejects radius above max`() {
|
||||
assertThrows(IllegalArgumentException::class.java) {
|
||||
BlurTransformation(
|
||||
context = mockk<Context>(relaxed = true),
|
||||
radius = 26f,
|
||||
sampling = 2.5f
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user