Skip to content

Commit

Permalink
Replace usages.
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrtwhite committed Nov 19, 2024
1 parent 3ad0da6 commit 40b75d8
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class FakeImageLoaderEngineTest : RobolectricTest() {
@Test
fun extraData() = runTest {
val url = "https://www.example.com/image.jpg"
val image = FakeImage()
val image = ColorImage()
val engine = FakeImageLoaderEngine.Builder()
.intercept(url, image)
.build()
Expand All @@ -39,9 +39,9 @@ class FakeImageLoaderEngineTest : RobolectricTest() {
@Test
fun predicateData() = runTest {
val url = "https://www.example.com/image.jpg"
val image = FakeImage()
val image = ColorImage()
val engine = FakeImageLoaderEngine.Builder()
.intercept("different_string", FakeImage())
.intercept("different_string", ColorImage())
.intercept({ it is String && it == url }, image)
.build()
val imageLoader = ImageLoader.Builder(context)
Expand All @@ -61,9 +61,9 @@ class FakeImageLoaderEngineTest : RobolectricTest() {
@Test
fun defaultDrawable() = runTest {
val url = "https://www.example.com/image.jpg"
val image = FakeImage()
val image = ColorImage()
val engine = FakeImageLoaderEngine.Builder()
.intercept("different_string", FakeImage())
.intercept("different_string", ColorImage())
.default(image)
.build()
val imageLoader = ImageLoader.Builder(context)
Expand All @@ -84,7 +84,7 @@ class FakeImageLoaderEngineTest : RobolectricTest() {
fun optionalInterceptor() = runTest {
var currentIndex = -1
val url = "https://www.example.com/image.jpg"
val images = listOf(FakeImage(), FakeImage(), FakeImage())
val images = listOf(ColorImage(), ColorImage(), ColorImage())
fun testInterceptor(index: Int) = OptionalInterceptor { chain ->
if (currentIndex == index) {
SuccessResult(images[index], chain.request, DataSource.MEMORY)
Expand Down Expand Up @@ -119,7 +119,7 @@ class FakeImageLoaderEngineTest : RobolectricTest() {
fun requestTransformerEnforcesInvariants() = runTest {
val url = "https://www.example.com/image.jpg"
val engine = FakeImageLoaderEngine.Builder()
.intercept(url, FakeImage())
.intercept(url, ColorImage())
.requestTransformer { request ->
request.newBuilder()
.data(null)
Expand Down

0 comments on commit 40b75d8

Please sign in to comment.