Last active
February 18, 2018 08:53
-
-
Save plnice/8f0140236a327d5eb6689b42ac6a8ee7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun withDrawable(@DrawableRes id: Int) = object : TypeSafeMatcher<View>() { | |
override fun describeTo(description: Description) { | |
description.appendText("ImageView with drawable same as drawable with id $id") | |
} | |
override fun matchesSafely(view: View): Boolean { | |
val context = view.context | |
val expectedDrawable = context.getDrawable(id) | |
return view is ImageView && ??? // what now? | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment